public void DisableAllTraps() { GameObject[] triggersGO = GameObject.FindGameObjectsWithTag("Trap"); foreach (GameObject go in triggersGO) { Trap trapGO = go.GetComponent <Trap>(); if (trapGO != null) { trapGO.DisableTrap(); } } }
public void DisableAllTraps() { GameObject[] triggersGO = GameObject.FindGameObjectsWithTag("Trap"); foreach (GameObject go in triggersGO) { Trap trapGO = go.GetComponent <Trap>(); if (trapGO != null) { trapGO.DisableTrap(); } } }