예제 #1
0
    // Update is called once per frame
    void Update()
    {
        if (gameStart && !secondLoopStarted)
        {
            //When the game has started, if the intro is done playing loop the seocnd part forever
            if (!BGmusicSource.isPlaying)
            {
                BGloopsource.Play();
                secondLoopStarted = true;
            }
        }

        if (!GetComponent <PickupsAndStats>().Alive)        //when Robo dies
        {
            //hud.SetActive(false);
            resultsHUD.SetActive(true);
            ThrowBtn.SetActive(false);
            JumpBtn.SetActive(false);
            LeftBtn.SetActive(false);
            RightBtn.SetActive(false);
            // instance.ShowBanner();

            //Fade the music out
            StartCoroutine(FadeOut(BGmusicSource, 3.5f));
            StartCoroutine(FadeOut(BGloopsource, 3.5f));
        }
        if (GetComponent <PickupsAndStats>().Alive)
        {
            //instance.HideBanner();
        }
    }
예제 #2
0
 public void Begin()
 {
     GameStart = true;
     hud.SetActive(true);
     MainMenu.SetActive(false);
     ThrowBtn.SetActive(true);
     JumpBtn.SetActive(true);
     LeftBtn.SetActive(true);
     RightBtn.SetActive(true);
     //BGmusicSource.Play();
     //instance.HideBanner();
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     BGmusicSource.clip = BGmusic; //sets up the music
     BGloopsource.clip  = BGloop;  //BGloop is what loops after the intro is done
     hud.SetActive(true);
     ThrowBtn.SetActive(false);
     JumpBtn.SetActive(false);
     LeftBtn.SetActive(false);
     RightBtn.SetActive(false);
     resultsHUD.SetActive(false);
     //load the game stats when starting scene over
     LoadGame();
 }