private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Enemy") { UI_controller script_from_UI = GameObject.Find("Canvas").GetComponent <UI_controller>(); script_from_UI.Game_over(); } }
private void Awake() { instance = this; P1_child = P1_progress_bar.transform.GetChild(0).gameObject.GetComponent <Image>(); P2_child = P2_progress_bar.transform.GetChild(0).gameObject.GetComponent <Image>(); pointer_rect = clock_pointer.GetComponent <RectTransform>(); remaining_time = 300; next_switch = camera_switch_duration; time.text = "5 : 00"; StartCoroutine("timer"); next_consume = food_consume_time; }
private void Awake() { ui_controller = FindObjectOfType <UI_controller>(); }
private void Awake() { instance = this; P1_child = P1_progress_bar.transform.GetChild(0).gameObject.GetComponent <Image>(); P2_child = P2_progress_bar.transform.GetChild(0).gameObject.GetComponent <Image>(); }