void Awake() { _panelContainsButtonToClick = _buttonToClick.gameObject.transform.parent.gameObject; _panelContainsButtonToClickScript = _panelContainsButtonToClick.GetComponent <IPanel>(); _panelContainsButtonToClickScript.AddToList(_buttonToClick.GetComponent <ITriggerable>()); _buttonToClick.onClick.AddListener(UnpressedAllButtonsUnlessOne); Debug.Log("_buttonToClick " + gameObject.name); if (_panelToActive != null) { _buttonToClick.onClick.AddListener(DeactivateAllObjectUnlessOne); _buttonToClick.GetComponentInParent <ViewSwitchPanel>().AddToListObjectSwithPanel(_panelToActive); } }