#Are all contained elements destroyed when a window is closed?
1 messages · Page 1 of 1 (latest)
I'm using Harmony postfixing as a kind of listener for when the RegisterWindow method is called, which isn't a problem as I need to use Harmony for my solution anyway. However, if you can think of a better way to do this I'm all ears 🙂
{
if (OnClose != null && !OnCloseAfter)
{
OnClose();
}
if (OnlyHide)
{
bool shown = Shown;
WindowManager.DeregisterWindow(this);
base.gameObject.SetActive(value: false);
if (SpawnFrom != null && shown)
{
WindowManager.SpawnFader(SpawnFrom, rectTransform);
}
if (Parent != null && Parent.Child == this && Parent.BlockPanel != null)
{
Parent.Child = null;
UnityEngine.Object.Destroy(Parent.BlockPanel);
}
}
else
{
UnityEngine.Object.Destroy(base.gameObject);
}
if (OnClose != null && OnCloseAfter)
{
OnClose();
}
}```
Ok I read through the GUIWindow class and it seems they destroy themselves. Neat.
Can I mark this as solved or does someone else have to do that?