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);
        }
        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. 3
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();
        }
        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);

            // obscure the screen
            yield return(Core.startCoroutine(tickEffectProgressProperty(_textureWipeEffect, duration, easeType)));

            // load up the new Scene
            yield return(Core.startCoroutine(loadNextScene()));

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

            // undo the effect
            yield return(Core.startCoroutine(
                             tickEffectProgressProperty(_textureWipeEffect, duration, EaseHelper.oppositeEaseType(easeType), true)));

            transitionComplete();

            // cleanup
            _overlayTexture.Dispose();
            Core.content.unloadEffect(_textureWipeEffect);
        }