public void Disable() { if (drawer == null) { return; } Object.Destroy(drawer); drawer = null; }
public void Enable(int currentDepth) { if (drawer != null) { return; } drawer = new GameObject(owner.Name + "_DrawerObject").AddComponent <GUIDrawerObject>(); drawer.layer = currentDepth; drawer.owner = this; drawer.Cancel(); Object.DontDestroyOnLoad(drawer); }