Exemplo n.º 1
0
        /// <summary>
        /// Updates the FPS Related Variables and UI Elements
        /// </summary>
        public void UpdateFPSModule()
        {
            if (!useFPSModule)
            {
                XDebug.ManagerLog("FPS MODULE IS INACTIVE", "****UI MANAGER****");
                return;
            }

            if (currentAmmoText)
            {
                currentAmmoText.text = currentAmmo.ToString();
            }

            if (clipSizeText)
            {
                clipSizeText.text = clipSize.ToString();
            }

            if (totalAmmoText)
            {
                totalAmmoText.text = totalAmmo.ToString();
            }

            if (currentGrenadesText)
            {
                currentGrenadesText.text = currentGrenades.ToString();
            }

            if (totalGrenadesText)
            {
                totalGrenadesText.text = totalGrenades.ToString();
            }
        }
Exemplo n.º 2
0
        private void IncrementTime()
        {
            if (isExpired)
            {
                Debug.Log("Game Timer is Expired");
                return;
            }
            if (timer < TotalTime)
            {
                timer++;
            }
            else if (timer == TotalTime)
            {
                if (isDebug)
                {
                    XDebug.ManagerLog("Invoking Expired Event", "****TIMER****");
                    TimerExpired.Invoke();
                }
                else
                {
                    TimerExpired.Invoke();
                }

                isExpired = true;
                CancelInvoke("IncrementTime");
                CancelInvoke("DecrementTime");
                if (isDebug)
                {
                    XDebug.ManagerLog("TimerExpired", "****TIMER****");
                }
            }

            if (!isExpired)
            {
                FormatTime(timer);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Updates the Health Related Variables and UI Elements
        /// </summary>
        public void UpdateHealthModule()
        {
            if (!useHealthModule)
            {
                XDebug.ManagerLog("HEALTH MODULE IS INACTIVE", "****UI MANAGER****");
                return;
            }


            if (healthText)
            {
                healthText.text = CurrentHealth.ToString();
            }

            if (CurrentHealth > MaxHealth)
            {
                CurrentHealth = MaxHealth;
            }

            if (CurrentHealth < 0)
            {
                CurrentHealth = 0;
            }
        }