예제 #1
0
 void OnTriggerEnter(Collider other)
 {
     if (other.tag == "Zombie")
     {
         if (zombies.ContainsKey(other))
         {
             zombies[other] += 1;
         }
         else
         {
             zombies[other] = 1;
         }
     }
     if (other.tag == "Destructible")
     {
         if (destructibles.ContainsKey(other))
         {
             destructibles[other] += 1;
         }
         else
         {
             destructibles[other] = 1;
         }
     }
     if (other.tag == "FootballZombie")
     {
         bossHealth = other.GetComponent <FootballZombieHealth>();
     }
 }
예제 #2
0
 // Use this for initialization
 void Start()
 {
     _player = GameObject.Find("Player").GetComponent <Player>();
     _health = GetComponent <FootballZombieHealth>();
     CC      = GetComponent <CharacterController>();
     curAnim = GetComponent <tk2dSpriteAnimator>();
     FZSM    = GetComponent <FootballZombieSM>();
 }
예제 #3
0
 void drawBossHealth()
 {
     if (boss)
     {
         FootballZombieHealth bossHealth = boss.GetComponent <FootballZombieHealth>();
         float percent        = bossHealth.health / (float)bossHealth.maxHealth;
         int   ctrlKeysOffset = (int)stunKeyPosition.xMax;
         drawPercentBar(100 + ctrlKeysOffset, Screen.height - 75, Screen.width - 200 - ctrlKeysOffset, 50, percent, redBox, "Boss Health", 0, false);
     }
 }
예제 #4
0
 void OnTriggerEnter(Collider other)
 {
     if(other.tag == "Zombie"){
         if (zombies.ContainsKey(other)) {
             zombies[other] += 1;
         } else {
             zombies[other] = 1;
         }
     }
     if(other.tag == "Destructible"){
         if (destructibles.ContainsKey(other)) {
             destructibles[other] += 1;
         } else {
             destructibles[other] = 1;
         }
     }
     if (other.tag == "FootballZombie") {
         bossHealth = other.GetComponent<FootballZombieHealth>();
     }
 }
예제 #5
0
 void OnTriggerExit(Collider other)
 {
     if (other.tag == "Zombie")
     {
         if (zombies.ContainsKey(other))
         {
             zombies[other] -= 1;
             if (zombies[other] == 0)
             {
                 zombies.Remove(other);
             }
         }
         else
         {
             Debug.LogError("removed a nonexistant zombie");
         }
     }
     if (other.tag == "Destructible")
     {
         if (destructibles.ContainsKey(other))
         {
             destructibles[other] -= 1;
             if (destructibles[other] == 0)
             {
                 destructibles.Remove(other);
             }
         }
         else
         {
             Debug.LogError("removed a nonexistant destructible");
         }
     }
     if (other.tag == "FootballZombie")
     {
         bossHealth = null;
     }
 }
예제 #6
0
 // Use this for initialization
 void Start()
 {
     _player = GameObject.Find("Player").GetComponent<Player>();
     _health = GetComponent<FootballZombieHealth>();
     CC = GetComponent<CharacterController>();
     curAnim = GetComponent<tk2dSpriteAnimator>();
     FZSM = GetComponent<FootballZombieSM>();
 }
예제 #7
0
 void OnTriggerExit(Collider other)
 {
     if(other.tag == "Zombie"){
         if (zombies.ContainsKey(other)) {
             zombies[other] -= 1;
             if (zombies[other] == 0) {
                 zombies.Remove(other);
             }
         } else {
             Debug.LogError("removed a nonexistant zombie");
         }
     }
     if(other.tag == "Destructible"){
         if (destructibles.ContainsKey(other)) {
             destructibles[other] -= 1;
             if (destructibles[other] == 0) {
                 destructibles.Remove(other);
             }
         } else {
             Debug.LogError("removed a nonexistant destructible");
         }
     }
     if (other.tag == "FootballZombie") {
         bossHealth = null;
     }
 }