public void CloseWindow() { var thisDrawer = WindowDrawers.FirstOrDefault(w => w.Window == this); if (thisDrawer != null) { thisDrawer.Window = null; } Visible = false; }
public void OpenWindow() { if (WindowDrawers.Any(w => w.Window == this)) { return; } var windowDrawer = WindowDrawers.FirstOrDefault(w => w.Window == null) ?? GameObject.AddComponent <WindowDrawer>(); windowDrawer.Window = this; Visible = true; }