Exemple #1
0
    void OnTimeLeftUpdate()
    {
        if (WarSceneController.state != WarSceneController.State.Running && WarSceneController.state != WarSceneController.State.Magic)
        {
            return;
        }

        timeTick += Time.deltaTime;
        if (timeTick >= 1)
        {
            timeTick = 0;

            timeLeft--;
            if (timeLeft <= 0)
            {
                timeLeft = 0;
                warCtrl.OnTimeUp();
            }

            timeLeftF.text = "" + timeLeft;
        }
    }