Example #1
0
 void Update()
 {
     if (!complete && (obj1 == null || obj1.name.Equals("Respawn")) && (obj2 == null || obj2.name.Equals("Respawn")) && (obj3 == null || obj3.name.Equals("Respawn")))
     {
         alert.SetActive(false);
         complete = true;
         ScoreManager.AddDefensive(3);
     }
 }
    // Wigg's Brew - increase health by 1 and glow red
    IEnumerator WiggsBrew()
    {
        ScoreManager.AddDefensive(5);
        soundManager.PlaySound(soundManager.lifeup);
        uiManager.Powerup("Wigg's Brew: +1 Health", Color.red);
        lifeup.SetActive(true);
        yield return(new WaitForSeconds(3));

        uiManager.Powerup("", Color.white);
        lifeup.SetActive(false);
    }
Example #3
0
    IEnumerator Block()
    {
        if (timers.transform.GetChild(0).gameObject.GetComponent <TimerController>().CanAttack())
        {
            // Start Blocking
            isBlocking = true;
            // Animate Block
            soundManager.PlaySound(soundManager.block);
            weapon.SetActive(false);
            shield.SetActive(true);
            yield return(new WaitForSeconds(2));

            // Stop Blocking
            shield.SetActive(false);
            weapon.SetActive(true);
            isBlocking = false;
            ScoreManager.AddDefensive(1);
            timers.transform.GetChild(0).gameObject.GetComponent <TimerController>().Reset();
        }
    }