Exemple #1
0
 // When colliding with the veige, reached is true
 void OnCollisionEnter(Collision collision)
 {
     // If there is a vegie component on the colliding object
     if (collision.gameObject.GetComponent <Vegie>() != null)
     {
         // Assign the vegie component
         vegie = collision.gameObject.GetComponent <Vegie>();
         // The bug has reached the vegie
         m_ArrivedAtTarget = true;
     }
 }
Exemple #2
0
 private void Peel(Vegie vegetable)
 {
     vegetable.Peel();
 }
Exemple #3
0
 // Initialise the bug when removed from the pool
 void OnEnable()
 {
     m_WaitTimer       = 0f;
     m_ArrivedAtTarget = false;
     vegie             = null;
 }
Exemple #4
0
 private void Cut(Vegie vegetable)
 {
     vegetable.Cut();
 }