// Update is called once per frame void Update() { if (invalidated) { ArrayList list = PitManager.pits; for (int i = 0; i < list.Count; i++) { PitManager.Pit pit = (PitManager.Pit)list [i]; if (pit.InIt(gameObject.transform.position)) { pit.AddSeed(gameObject); invalidated = false; break; } } } }
public void water(Vector3 pos) { ArrayList pits = PitManager.pits; for (int i = 0; i < pits.Count; i++) { PitManager.Pit pit = (PitManager.Pit)pits [i]; if (pit.InIt(pos)) { if (pit.HasSeed) { pit.GrowFlower(); pits.RemoveAt(i); } break; } } }