public void Deactivate() { foreach (Transform row in transform) { foreach (Transform child in row) { PotentialFieldElement element = child.GetComponent <PotentialFieldElement> (); if (element) { element.Clear(); } } } gameObject.SetActive(false); }
public void Activate(EPheromoneTypes pheromoneType) { gameObject.SetActive(true); _pheromoneType = pheromoneType; foreach (Transform row in transform) { foreach (Transform child in row) { PotentialFieldElement element = child.GetComponent <PotentialFieldElement> (); if (element) { element.pheromoneType = _pheromoneType; } } } }