Exemple #1
0
 public void CustomEvent(int id)
 {
     //active dangerZone
     if (id == 1)
     {
         dangerZone.SetActive(true);
     }
     if (id == 2)
     {
         msa.allowRocketLauncher = true;
     }
     if (id == 3)
     {
         spawnShield     = true;
         kba.allowShield = true;
         ShieldUI.SetActive(true);
     }
     if (id == 4)
     {
         tn.maxHp += 25;
         tn.hp     = tn.maxHp;
         tn.AdjustUI();
     }
     if (id == 5)
     {
         EndGame();
     }
     if (id == 6)     //switch music
     {
         MusicSwitcher.GetComponent <MusicScript>().curMusic++;
         MusicSwitcher.GetComponent <AudioSource>().clip = MusicSwitcher.GetComponent <MusicScript>().music[MusicSwitcher.GetComponent <MusicScript>().curMusic];
         MusicSwitcher.GetComponent <AudioSource>().Play();
     }
 }
Exemple #2
0
    public void CustomEvent(int id)
    {
        if (id == 1)      //BoostShip
        {
            tn.maxHp    += 125;
            tn.hp        = tn.maxHp;
            mv.maxSpeed += 200;
            if (mv.speed <= mv.maxSpeed)
            {
                mv.speed = mv.maxSpeed;
            }
            tn.AdjustUI();
        }

        else if (id == 2)      //Install RcktLaunch
        {
            msa.allowRocketLauncher = true;
        }

        else if (id == 3)      //Install Shield
        {
            spawnShield     = true;
            kba.allowShield = true;
            ShieldUI.SetActive(true);
        }

        else if (id == 4)     //switch music
        {
            MusicSwitcher.GetComponent <MusicScript>().curMusic++;
            MusicSwitcher.GetComponent <AudioSource>().clip = MusicSwitcher.GetComponent <MusicScript>().music[MusicSwitcher.GetComponent <MusicScript>().curMusic];
            MusicSwitcher.GetComponent <AudioSource>().Play();
        }

        else if (id == 5)
        {
            sp.maxShield   += 150;
            sp.shieldRegen += 3;
            sp.energy       = sp.maxShield;
        }
    }