Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] VirtualizedScrollRectList tries to start a coroutine even when disabled. #828

Open
SVRAAIB opened this issue Jul 5, 2024 · 0 comments
Assignees
Labels
Type: Bug A problem with an existing feature that can be fixed with the next patched release.

Comments

@SVRAAIB
Copy link

SVRAAIB commented Jul 5, 2024

Describe the bug

OnVisible and OnInvisible triggers ResetLayout wich tries to start the coroutine ResetLayoutNextFrame without checking if the GameOvject is active.
This raises an error : Coroutine couldn't be started because the the game object '[GameObject name]' is inactive!

To reproduce

Steps to reproduce the behavior:

  1. Create a new scene
  2. Remove everything from the scene
  3. Add the prefab VirtualizedScrollRectListTest
  4. Create a small class that binds to VirtualizedScrollRectListTest.OnVisible when the VirtualizedScrollRectListTest isn't active.
    For example i attached this script to the VirtualizedScrollRectListTest prefab :
    public class TestVirtualizedList : MonoBehaviour
    {
    [SerializeField] private VirtualizedScrollRectList virtualizedScrollRectList;
    private void OnEnable() {virtualizedScrollRectList.OnVisible += HandleVisible;}
    private void OnDisable() {virtualizedScrollRectList.OnVisible -= HandleVisible;}
    public void HandleVisible(GameObject gameObject, int index){}
    }
    and disabled the prefab. I tested by putting this compponent on a parent and then a child of the GameObject that has the VirtualizedScrollRectListTest component.
  5. The error "Coroutine couldn't be started because the the game object '[GameObject name]' is inactive!" should appear in the console

Expected behavior

Being able to bind and unbind to the OnVisible and OnInvisible Actions even if the GameObject of the VirtualizedScrollRectListTest is inactive.

Your setup (please complete the following information)

  • Unity Version: 2022.3.22f1
  • MRTK Version: v3.0
  • UX Core package version: uxcore-3.2.0

Target platform

  • HoloLens 2
@SVRAAIB SVRAAIB added Needs: Triage Needs to be triaged. Type: Bug A problem with an existing feature that can be fixed with the next patched release. labels Jul 5, 2024
@shaynie shaynie removed the Needs: Triage Needs to be triaged. label Jul 24, 2024
@shaynie shaynie assigned shaynie and keveleigh and unassigned shaynie Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug A problem with an existing feature that can be fixed with the next patched release.
Projects
None yet
Development

No branches or pull requests

3 participants