예제 #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);
        }
예제 #2
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();
        }
예제 #3
0
        public override IEnumerator OnBeginTransition()
        {
            var startAt = DateTime.Now;

            while ((DateTime.Now - startAt).TotalSeconds < this.FadeOutDuration)
            {
                var elapsed = (float)(DateTime.Now - startAt).TotalSeconds;
                this.color = Lerps.Ease(
                    this.FadeEaseType,
                    ref this.fromColor,
                    ref this.toColor,
                    elapsed,
                    this.FadeOutDuration);

                yield return(null);
            }

            this.SetNextScene();

            yield return(DefaultCoroutines.Wait(this.DelayBeforeFadeInDuration));

            startAt = DateTime.Now;
            while ((DateTime.Now - startAt).TotalSeconds < this.FadeInDuration)
            {
                var elapsed = (float)(DateTime.Now - startAt).TotalSeconds;
                this.color = Lerps.Ease(
                    EaseHelper.OppositeEaseType(this.FadeEaseType),
                    ref this.toColor,
                    ref this.fromColor,
                    elapsed,
                    this.FadeInDuration);

                yield return(null);
            }

            this.TransitionComplete();
        }
예제 #4
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();
        }