Ejemplo n.º 1
0
 public void ActivateGuard(GameObject go)
 {
     GameObject[] tabGuard    = gm.GetTabGuard();
     int[]        guardActive = gm.GetActiveGuard();
     gm.UpgradeGuardActive();
     for (int i = 0; i < tabGuard.Length; i++)
     {
         if (go.Equals(tabGuard [i]))
         {
             guardActive [i] = 1;
             Life life = tabGuard [i].GetComponent <Life> ();
             tabGuard [i].GetComponent <SpriteRenderer> ().color = new Color(1f, 1f, 1f, 1f);
             life.SetLifeBase();
             life.SetAlive(true);
             life.InitTabEnnemyBlock();
             break;
         }
     }
     for (int i = 0; i < tabGuard.Length; i++)
     {
         if (guardActive [i] == 0)
         {
             tabGuard [i].GetComponent <SpriteRenderer> ().color = new Color(1f, 1f, 1f, 1f);
             tabGuard [i].SetActive(false);
             Life life = tabGuard [i].GetComponent <Life> ();
             life.SetAlive(false);
             life.InitTabEnnemyBlock();
         }
     }
     upgrade = false;
     GameState.unfreezeTime();
 }