// Use this for initialization void Start() { // Get button component and connect it Button btn = GetComponent <Button> (); btn.onClick.AddListener(TaskOnClick); // Get UIController uiController = GameObject.FindGameObjectWithTag("MessengerController").GetComponent <UIControllerMessenger> (); }
// Use this for initialization void Start() { button = GetComponent <Button> (); GameObject go = GameObject.FindGameObjectWithTag(tagGameControllerMessenger); if (go != null) { uiMessenger = go.GetComponent <UIControllerMessenger> (); } }
// -------------- Inherited from MonoBehavior ---------------------------- // void Awake() { ear = GetComponent <Ear> (); mouth = GetComponent <Mouth>(); uiController = GetComponent <UIControllerMessenger> (); }