Esempio n. 1
0
        public override IEnumerator OnBeginTransition()
        {
            // create a single pixel transparent texture so we can do our squares out to the next scene
            _overlayTexture = Graphics.CreateSingleColorTexture(1, 1, Color.Transparent);

            // populate squares
            yield return(Core.StartCoroutine(TickEffectProgressProperty(_squaresEffect, SquaresInDuration, EaseType)));

            // load up the new Scene
            yield return(Core.StartCoroutine(LoadNextScene()));

            // dispose of our previousSceneRender. We dont need it anymore.
            PreviousSceneRender.Dispose();
            PreviousSceneRender = null;

            // delay
            yield return(Coroutine.WaitForSeconds(DelayBeforeSquaresInDuration));

            // unpopulate squares
            yield return(Core.StartCoroutine(TickEffectProgressProperty(_squaresEffect, SquaresInDuration,
                                                                        EaseHelper.OppositeEaseType(EaseType), true)));

            TransitionComplete();

            // cleanup
            _overlayTexture.Dispose();
            Core.Content.UnloadEffect(_squaresEffect.Name);
        }
Esempio n. 2
0
        /// <summary>
        /// called after the previousSceneRender occurs for the first (and only) time. At this point you can load your new Scene after
        /// yielding one frame (so the first render call happens before scene loading).
        /// </summary>
        public virtual IEnumerator OnBeginTransition()
        {
            yield return(null);

            yield return(Core.StartCoroutine(LoadNextScene()));

            TransitionComplete();
        }
Esempio n. 3
0
        public override IEnumerator OnBeginTransition()
        {
            // load up the new Scene
            yield return(Core.StartCoroutine(LoadNextScene()));

            // wind to the new Scene
            yield return(Core.StartCoroutine(TickEffectProgressProperty(_windEffect, Duration, EaseType)));

            TransitionComplete();

            // cleanup
            Core.Content.UnloadEffect(_windEffect.Name);
        }
Esempio n. 4
0
        public override IEnumerator OnBeginTransition()
        {
            yield return(null);

            // load up the new Scene
            yield return(Core.StartCoroutine(LoadNextScene()));

            var elapsed = 0f;

            while (elapsed < FadeDuration)
            {
                elapsed += Time.DeltaTime;
                _color   = Lerps.Ease(FadeEaseType, ref _fromColor, ref _toColor, elapsed, FadeDuration);

                yield return(null);
            }

            TransitionComplete();
        }
Esempio n. 5
0
        public override IEnumerator OnBeginTransition()
        {
            yield return(null);

            // load up the new Scene
            yield return(Core.StartCoroutine(LoadNextScene()));

            var elapsed = 0f;

            while (elapsed < Duration)
            {
                elapsed         += Time.DeltaTime;
                _destinationRect = Lerps.Ease(TransitionEaseType, ref _textureBounds, ref _finalRenderRect, elapsed, Duration);

                yield return(null);
            }

            TransitionComplete();
        }
Esempio n. 6
0
        public override IEnumerator OnBeginTransition()
        {
            yield return(null);

            var elapsed = 0f;

            while (elapsed < Duration)
            {
                elapsed        += Time.DeltaTime;
                _renderScale    = Lerps.Ease(ScaleEaseType, MaxScale, MinScale, elapsed, Duration);
                _renderRotation = Lerps.Ease(RotationEaseType, MinRotation, MaxRotation, elapsed, Duration);

                yield return(null);
            }

            // load up the new Scene
            yield return(Core.StartCoroutine(LoadNextScene()));

            // dispose of our previousSceneRender. We dont need it anymore.
            PreviousSceneRender.Dispose();
            PreviousSceneRender = null;

            yield return(Coroutine.WaitForSeconds(DelayBeforeMaskOut));

            elapsed = 0f;
            while (elapsed < Duration)
            {
                elapsed     += Time.DeltaTime;
                _renderScale = Lerps.Ease(EaseHelper.OppositeEaseType(ScaleEaseType), MinScale, MaxScale, elapsed,
                                          Duration);
                _renderRotation = Lerps.Ease(EaseHelper.OppositeEaseType(RotationEaseType), MaxRotation, MinRotation,
                                             elapsed, Duration);

                yield return(null);
            }

            TransitionComplete();
        }
Esempio n. 7
0
        public override IEnumerator OnBeginTransition()
        {
            // create a single pixel texture of our fadeToColor
            _overlayTexture = Graphics.CreateSingleColorTexture(1, 1, FadeToColor);

            var elapsed = 0f;

            while (elapsed < FadeOutDuration)
            {
                elapsed += Time.DeltaTime;
                _color   = Lerps.Ease(FadeEaseType, ref _toColor, ref _fromColor, elapsed, FadeOutDuration);

                yield return(null);
            }

            // load up the new Scene
            yield return(Core.StartCoroutine(LoadNextScene()));

            // dispose of our previousSceneRender. We dont need it anymore.
            PreviousSceneRender.Dispose();
            PreviousSceneRender = null;

            yield return(Coroutine.WaitForSeconds(DelayBeforeFadeInDuration));

            elapsed = 0f;
            while (elapsed < FadeInDuration)
            {
                elapsed += Time.DeltaTime;
                _color   = Lerps.Ease(EaseHelper.OppositeEaseType(FadeEaseType), ref _fromColor, ref _toColor, elapsed,
                                      FadeInDuration);

                yield return(null);
            }

            TransitionComplete();
            _overlayTexture.Dispose();
        }