Exemple #1
0
 void OnTriggerEnter(Collider Other)
 {
     // control the pathIndex depending on if moving towards base or spawner
     if (Other.tag == "PathPoint" && isReportIntel == false)
     {
         pathIndex++;
     }
     else if (Other.tag == "PathPoint" && isReportIntel == true)
     {
         pathIndex--;
     }
     else if (Other.tag == "EnemySpawn" && isReportIntel == true)
     {
         overlord.GetComponent <Overlord>().ReceiveSpotList(intel.GetSpottedList(), pathList);
         overlord.GetComponent <Overlord>().DecreaseMinionCount();
         Destroy(gameObject);
     }
     else if (Other.tag == "Base")
     {
         Other.GetComponent <BaseSpecs>().ReduceHealth(1);
         overlord.GetComponent <Overlord>().DecreaseMinionCount();
         Destroy(gameObject);
     }
 }