Example #1
0
            public override void Execute(CommandQueue commandQueue, Action onComplete)
            {
                SpriteFader.FadeSprite(spriteRenderer, targetColor, fadeDuration, slideOffset);

                // Fade is asynchronous, but command completes immediately.
                // If you need to wait for the fade to complete, just use an additional Wait() command
                if (onComplete != null)
                {
                    onComplete();
                }
            }
Example #2
0
        public override void OnEnter()
        {
            if (spriteRenderer == null)
            {
                Continue();
                return;
            }

            SpriteFader.FadeSprite(spriteRenderer, _targetColor.Value, _duration.Value, Vector2.zero, delegate {
                if (waitUntilFinished)
                {
                    Continue();
                }
            });

            if (!waitUntilFinished)
            {
                Continue();
            }
        }
Example #3
0
 IEnumerator CharacterFadeOut()
 {
     yield return(SpriteFader.FadeSprite(m_CharacterImage, new Color(1, 1, 1, 1), new Color(1, 1, 1, 0), 1f));
 }
Example #4
0
    IEnumerator SetNewCharacterAndFadeIn(Sprite sprite)
    {
        m_CharacterImage.sprite = sprite;

        yield return(SpriteFader.FadeSprite(m_CharacterImage, new Color(1, 1, 1, 0), new Color(1, 1, 1, 1), 1f));
    }