Example #1
0
        private void Update()
        {
            // show fadeout when game is running or has ended
            if (MainBase.Instance.state == GameState.Running || MainBase.Instance.state == GameState.Ended)
            {
                if (_fadeInTimer != null)
                {
                    _fadeInTimer.Update();
                    ApplyFadeIn();

                    if (_fadeInTimer.hasEnded)
                    {
                        SetMaterialColor(Color.white);
                        _fadeInTimer = null;
                    }
                }
                else if (_fadeOutTimer != null)
                {
                    _fadeOutTimer.Update();
                    ApplyFadeOut();

                    if (_fadeOutTimer.hasEnded)
                    {
                        SetMaterialColor(Color.white.WithAlpha(0));
                        _fadeOutTimer = null;
                    }
                }
            }
        }
        public void Update()
        {
            if (!_timer.hasEnded)
            {
                _timer.Update();
                UpdateColor();
            }

            if (_timer.hasEnded)
            {
                for (int i = 0; i < _text.Length; i++)
                {
                    _text[i].enabled = false;
                }
            }
        }
Example #3
0
        void Update()
        {
            // TODO: had to comment this because of main character having no walk animation when steered by Sequence
            //if (_animator != null)
            //{
            //	if (BaseGameController.Instance.state == GameState.Running)
            //	{
            //		_animator.speed = 1.0f;
            //	}
            //	else
            //	{
            //		_animator.speed = 0f;
            //	}
            //}

            // show fadeout when game is running or has ended
            if (BaseGameController.Instance.state == GameState.Running || BaseGameController.Instance.state == GameState.Ended)
            {
                if (_fadeInTimer != null)
                {
                    _fadeInTimer.Update();
                    ApplyFadeIn();

                    if (_fadeInTimer.hasEnded)
                    {
                        SetMaterialColor(new Color(1.0f, 1.0f, 1.0f, 1f));
                        _fadeInTimer = null;
                    }
                }
                else if (_fadeOutTimer != null)
                {
                    _fadeOutTimer.Update();
                    ApplyFadeOut();

                    if (_fadeOutTimer.hasEnded)
                    {
                        SetMaterialColor(new Color(1.0f, 1.0f, 1.0f, 0f));
                        _fadeOutTimer = null;
                    }
                }
            }
        }
Example #4
0
        void Update()
        {
            if (_animator != null)
            {
                if (BaseGameController.Instance.state == GameState.Running)
                {
                    _animator.speed = 1.0f;
                }
                else
                {
                    _animator.speed = 0f;
                }
            }

            // show fadeout when game is running or has ended
            if (BaseGameController.Instance.state == GameState.Running || BaseGameController.Instance.state == GameState.Ended)
            {
                if (_fadeInTimer != null)
                {
                    _fadeInTimer.Update();
                    ApplyFadeIn();

                    if (_fadeInTimer.hasEnded)
                    {
                        SetMaterialColor(new Color(1.0f, 1.0f, 1.0f, 1f));
                        _fadeInTimer = null;
                    }
                }
                else if (_fadeOutTimer != null)
                {
                    _fadeOutTimer.Update();
                    ApplyFadeOut();

                    if (_fadeOutTimer.hasEnded)
                    {
                        SetMaterialColor(new Color(1.0f, 1.0f, 1.0f, 0f));
                    }
                }
            }
        }
Example #5
0
        void Update()
        {
            if (_timer.hasEnded)
            {
                _active     = !_active;
                source.mute = !_active;
                StartNewTimer();
            }

            if (_active)
            {
                if (fadeInFadeOut)
                {
                    source.volume = _timer.progress;
                }
                else
                {
                    source.volume = 1.0f;
                }
            }

            _timer.Update();
        }