NoesisWorldUI Repeated Instantiation on Game Object Enable
I am noticing that when a game object hierarchy containing a NoesisWorldUI is re-enabled, the associated XAML is reparsed, loaded, constructor invoked, and Initialized and InitializeComponent methods are reinvoked. This seems like a bug -- and I am looking to see how this might be happening by side effect. I am not seeing a similar or corresponding behavior in NoesisView. Can you guys comment on whether this should be happening?
Re: NoesisWorldUI Repeated Instantiation on Game Object Enable
Confirmed --
This isn't the correct behavior for Unity. In Unity, disabling a game object within the hierarchy should not mutate state -- or in this case, cause state to be evicted or reloaded. What would be more appropriate here is to just disable the renderer if the game object is disabled. OnDestroy is the Unity event to hook for evicting state.
https://www.noesisengine.com/bugs/view.php?id=2935
Code: Select all
void OnEnable()
{
FindContainer();
LoadContent();
AddContent();
}
void OnDisable()
{
RemoveContent();
_content = null;
_transform = null;
_containerPanel = null;
_camera = null;
}
https://www.noesisengine.com/bugs/view.php?id=2935
-
sfernandez
Site Admin
- Posts: 2997
- Joined:
Re: NoesisWorldUI Repeated Instantiation on Game Object Enable
Thanks for the ticket, let's continue the discussion there.
Who is online
Users browsing this forum: No registered users and 1 guest