Esempio n. 1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "score")
     {
         if (other.transform.parent.tag == "Player")
         {
             playerControl pc = other.transform.parent.GetComponent <playerControl> ();
             pc.objLevel = objLevel;
             pc.scoreAdd();
         }
         else
         {
             enemy enemyS = other.transform.parent.GetComponent <enemy> ();
             enemyS.objLevel = objLevel;
             enemyS.scoreAdd();
         }
         this.tag = "Untagged";
         this.GetComponent <Collider> ().enabled = false;
         StartCoroutine(waitDestroy());
     }
 }