// Update is called once per frame void Update() { if (health <= 0) { if (noise == 1) { restart r; r = GameObject.Find("Stats").GetComponent <restart>(); r.score++; } if (isGoal) { Goal_manager g_m = GameObject.FindGameObjectWithTag("Goal_manager").GetComponent <Goal_manager>(); for (int i = 0; i < g_m.Goal_blocks.Count; i++) { if (g_m.Goal_blocks[i] == gameObject) { g_m.Goal_blocks.Remove(g_m.Goal_blocks[i]); } } } Destroy(gameObject); } }
// Update is called once per frame void Update() { if (playerEnter) { g_m = GameObject.FindGameObjectWithTag("Goal_manager").GetComponent<Goal_manager>(); if(g_m.isOpen)isOpen=true; goExit (1); } }
// Update is called once per frame void Update() { if (playerEnter) { g_m = GameObject.FindGameObjectWithTag("Goal_manager").GetComponent <Goal_manager>(); if (g_m.isOpen) { isOpen = true; } goExit(1); } }