public void OnEnergyActive(FlowerEnergyBase flower) { if (parentFlowers.Contains(flower)) { return; } parentFlowers.Add(flower); EnergyActive(); }
private void OnActiveTriggerEnter(Collider2D collider) { FlowerEnergyBase flowerEnergy = collider.GetComponent <FlowerEnergyBase>(); if (flowerEnergy == null) { return; } StartCoroutine(ActiveEnergyOnFlower(flowerEnergy)); }
IEnumerator ActiveEnergyOnFlower(FlowerEnergyBase flowerEnergy) { yield return(new WaitForSeconds(0.5f)); flowerEnergy.OnEnergyActive(flowerEnergy); }