void TurnToysOn(DropColor dColor, int dLength) { if (boxes != null) { foreach (GameObject box in boxes) { StingerTrigger stingerBoxScript = box.GetComponent <StingerTrigger>(); if (stingerBoxScript != null) { stingerBoxScript.enabled = true; } box.SetActive(true); } } }
public void TurnOffToyBoxes() { Debug.Log("Turning off toy boxes"); if (boxes != null) { foreach (GameObject box in boxes) { StingerTrigger stingerBoxScript = box.GetComponent <StingerTrigger>(); if (stingerBoxScript != null) { stingerBoxScript.enabled = false; } box.SetActive(false); } } }