Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if (gameState == GameState.GameMenu)
     {
         //Show AppLovin Banner
         //	ApplovinShowBanner();
         MenuUI.SetActive(true);
         GOUI.SetActive(false);
         Joystick.SetActive(false);
         HUD.SetActive(false);
         if (Input.GetKeyDown(KeyCode.Escape))
         {
             ExitGame();
         }
     }
     else if (gameState == GameState.GamePlay)
     {
         if (!CheckingScore)
         {
             scm.CheckCurrentCoin();
             CheckingScore = true;
         }
         //disable Applovin Banner
         //	ApplovinHideBanner();
         MenuUI.SetActive(false);
         GOUI.SetActive(false);
         HUD.SetActive(true);
     }
     else if (gameState == GameState.GameOver)
     {
         //	ApplovinShowInterstitial ();
         //Chartboost.showRewardedVideo (CBLocation.Default);
         MenuUI.SetActive(false);
         GOUI.SetActive(true);
         HUD.SetActive(false);
         Joystick.SetActive(false);
     }
 }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        TM.text       = "Time: " + Timer.TimeScoreHours + ":" + Timer.TimeScoreMin + ":" + Timer.TimeScoreSeconds.ToString("f2");
        score.text    = "Score: " + plr.score + "/50";
        victime.text  = "Time: " + Timer.TimeScoreHours + ":" + Timer.TimeScoreMin + ":" + Timer.TimeScoreSeconds.ToString("f2");
        vicscore.text = "Score: " + plr.score + "/50";
        GOTime.text   = "Time: " + Timer.TimeScoreHours + ":" + Timer.TimeScoreMin + ":" + Timer.TimeScoreSeconds.ToString("f2");
        GOScore.text  = "Score: " + plr.score + "/50";
        if (plr.canmov == true)
        {
            if (PUI.IsPaused == false)
            {
                Stamcharge = true;
            }
            else
            {
                Stamcharge = false;
            }
        }
        if (plr.score >= 30)
        {
            ScoreImg.material = stamon;
        }
        if (plr.score < 30)
        {
            ScoreImg.material = stamdown;
        }
        if (plr.KeyboardMode == true)
        {
            ContImg.material = stamdown;
        }
        else
        {
            ContImg.material = stamon;
        }
        if (Stamcharge == true)
        {
            if (plr.inbox == true)
            {
                stamina.SetActive(true);
                stamina.GetComponent <Image>().fillAmount = stamina.GetComponent <Image>().fillAmount - 0.008f;
            }
            if (plr.inbox == false)
            {
                stamina.GetComponent <Image>().fillAmount = stamina.GetComponent <Image>().fillAmount + 0.01f;
            }
        }


        if (stamina.GetComponent <Image>().fillAmount == 0)
        {
            staminaImg.material = stamdown;
            plr.anim.SetBool("On", false);
            plr.inbox  = false;
            plr.canbox = false;
        }
        if (stamina.GetComponent <Image>().fillAmount == 1)
        {
            staminaImg.material = stamon;
            plr.canbox          = true;
        }
        if (plr.GO == true)
        {
            GOUI.SetActive(true);
            if (Input.anyKey)
            {
                SceneManager.LoadScene("Main");
            }
        }
        else
        {
            GOUI.SetActive(false);
        }
        if (Vic.VictoryOn == true)
        {
            VictoryUI.SetActive(true);
            if (Input.anyKey)
            {
                SceneManager.LoadScene("Main");
            }
        }
        else
        {
            VictoryUI.SetActive(false);
        }
    }