Ejemplo n.º 1
0
 void SpawnFish()
 {
     fishManager.MakeFish(transform.position,
                          transform.rotation,
                          GetComponent <HyperColliderManager>().w,
                          false);
     Invoke("SpawnFish", spawnTime);
 }
Ejemplo n.º 2
0
 void Update()
 {
     //check if the container is rotated to be upside down to start spawning food
     if (transform.parent)
     {
         if (Vector3.Dot(transform.up, Vector3.up) < -.2f)
         {
             if (curRate == pourRate)
             {
                 curRate = 0;
                 fishManager.MakeFish(opening.transform.position,
                                      opening.transform.rotation,
                                      GetComponent <HyperColliderManager>().w,
                                      true);
             }
             else
             {
                 curRate++;
             }
         }
     }
 }