public void HandleHit() { if (this.inTransit) { return; } // are we inside a container? PanelControl panel = this.gameObject.GetComponentInParent <PanelControl>(); if (panel) { if (panel.PanelState == PanelControl.PanelStates.IN_FRONT) { foreach (CubeDescription description in panel.GetComponentsInChildren <CubeDescription>()) { if (description != this) { description.description.gameObject.SetActive(false); } if (description != this) { description.button.gameObject.SetActive(false); } if (description != this) { description.ImageFrame.gameObject.SetActive(false); } } StartCoroutine(this.componentTransition()); //this.description.gameObject.SetActive(!this.description.gameObject.activeSelf); /* * foreach(PanelControl otherPanel in GameObject.FindObjectsOfType<PanelControl>()) * { * if (otherPanel != panel) * { * otherPanel.SwitchSubComponentState(this.gameObject.name, this.description.gameObject.activeSelf); * } * } */ } } else { this.description.gameObject.SetActive(!this.description.gameObject.activeSelf); this.button.gameObject.SetActive(!this.button.gameObject.activeSelf); this.ImageFrame.gameObject.SetActive(!this.ImageFrame.gameObject.activeSelf); } }