You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Create a new scene
Remove everything from the scene
Add the prefab VirtualizedScrollRectListTest
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.
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
The text was updated successfully, but these errors were encountered:
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:
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.
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)
Target platform
The text was updated successfully, but these errors were encountered: