Exemple #1
0
 // 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;
             }
         }
     }
 }
Exemple #2
0
    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;
            }
        }
    }