示例#1
0
 void OnCollisionEnter(Collision col)
 {
     if (col.collider.tag == "Ground")
     {
         Reset();
     }
     else if (col.collider.tag == "Collectable")
     {
         sm.Collect(col.transform);
     }
     else if (col.collider.tag == "Goal")
     {
         Debug.Log(sm.allStarsCollected.ToString());
         if (sm.allStarsCollected)
         {
             NextLevel();
         }
         else
         {
             Reset();
         }
     }
 }