Beispiel #1
0
        // Update is called once per frame
        void Update()
        {
            float timeToNextSpawn = SpawnManager.GetTimeToNextSpawn();

            if (timeToNextSpawn > 0)
            {
                if (timeToNextSpawn < 60)
                {
                    txtTimer.text = "Next Wave in " + timeToNextSpawn.ToString("f1") + "s";
                }
                else
                {
                    txtTimer.text = "Next Wave in " + (Mathf.Floor(timeToNextSpawn / 60)).ToString("f0") + "m";
                }
            }
            else
            {
                txtTimer.text = "";
            }
        }