Ejemplo n.º 1
0
        //Updates stats every 20th frame
        void Update()
        {
            //DELETE BEFORE RELEASE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1
            if (StatKeeper.getHealth() <= 0) //888888888888888888888888888888888888888888888888888888888888888888888888888
            {
                StatKeeper.healPlayer();     //!111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111
            }//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

            frames++;
            if (frames % 20 == 0)   //If the remainder of the current frame divided by 20 is 0 run the function.
            {
                UpdateStats();

                if (StatKeeper.getHealth() <= 0)
                {
                    Debug.Log("Player Died !");

                    Time.timeScale = 0f;

                    preventUIOverlap();

                    GameOver.SetActive(true);
                }
            }
        }
Ejemplo n.º 2
0
        //Updates stats every 20th frame
        void Update()
        {
            frames++;

            if (frames % 60 == 0)               //If the remainder of the current frame divided by 60 is 0 run the function.

            {
                UpdateStats();

                if (StatKeeper.getHealth() <= 0)
                {
                    Debug.Log("Player Died !");


                    if (!playerDed)
                    {
                        preventUIOverlap();

                        GameOver.SetActive(true);

                        DialogToggle.SetActive(false);

                        playerDed = true;
                    }
                }
            }
        }