public virtual void UpdateValue(int newValue, int oldVal)
        {
            _variableValue = newValue;
            var valFormatted = new StringBuilder(string.Format("{0}{1}", displayVariableName ? variableName + ": " : "", _variableValue.ToString("N0")));

            if (!useCommaFormatting)
            {
                valFormatted = valFormatted.Replace(",", "");
            }

            if (_text == null || !SpawnUtility.IsActive(_text.gameObject))
            {
                return;
            }

            if (useFixedNumberOfDigits)
            {
                while (valFormatted.Length < fixedDigitCount)
                {
                    valFormatted.Insert(0, "0");
                }
            }

            _text.text = valFormatted.ToString();
        }
Ejemplo n.º 2
0
        // ReSharper disable once UnusedMember.Local
        private void FixedUpdate()
        {
            if (_isDisabled)
            {
                return;
            }

            if (_player == null || !SpawnUtility.IsActive(_player.gameObject))
            {
                if (!_nextSpawnTime.HasValue)
                {
                    _nextSpawnTime = Time.time + RespawnDelay;
                }
                else if (Time.time >= _nextSpawnTime.Value && !LevelSettings.IsGameOver && PoolBoss.IsReady)
                {
                    SpawnPlayer();
                    _nextSpawnTime = null;
                }
            }
            else if (followPlayer)
            {
                UpdateSpawnPosition(_player.position);
            }
        }