Ejemplo n.º 1
0
        public override void Update()
        {
            if (IconShowState.ANIMATION_TIME < this.timeLine.currentTime)
            {
                this.owner.transform.localScale    = new Vector3(IconBehaviour.SCALE_RATE_IOS, IconBehaviour.SCALE_RATE_IOS, IconBehaviour.SCALE_RATE_IOS);
                this.owner.transform.localRotation = Quaternion.Euler(Vector3.zero);
                this.owner.enableTouch             = true;
                this.owner.vortexVfx.SetActive(false);
                return;
            }
            float scale    = Quadratic.EaseOut(this.timeLine.currentTime, 0f, IconBehaviour.SCALE_RATE_IOS, IconShowState.ANIMATION_TIME);
            float vfxScale = Quadratic.EaseOut(this.timeLine.currentTime, 0f, IconShowState.VFX_SCALE, IconShowState.ANIMATION_TIME);
            float rotate   = IconShowState.ROTATE_DEGREE - Quadratic.EaseOut(this.timeLine.currentTime, 0f, IconShowState.ROTATE_DEGREE, IconShowState.ANIMATION_TIME);

            this.owner.transform.localScale           = new Vector3(scale, IconBehaviour.SCALE_RATE_IOS, scale);
            this.owner.transform.localRotation        = Quaternion.Euler(new Vector3(0, -1f * rotate, 0));
            this.owner.vortexVfx.transform.localScale = new Vector3(vfxScale, vfxScale, vfxScale);
            this.timeLine.Next();
            return;
        }
Ejemplo n.º 2
0
        public override void Update()
        {
            if (IconShowState.ANIMATION_TIME < this.timeLine.currentTime)
            {
                this.owner.transform.localScale    = new Vector3(IconBehaviour.SCALE_RATE_ANDROID, IconBehaviour.SCALE_RATE_ANDROID, IconBehaviour.SCALE_RATE_ANDROID);
                this.owner.transform.localRotation = Quaternion.Euler(Vector3.up * -180f);
                this.owner.enableTouch             = true;
                this.owner.vortexVfx.SetActive(false);
                Notifier notifier = Notifier.GetInstance();
                notifier.Notify(NotifyMessage.OnIconShowComplete);
                return;
            }
            float scale    = Quadratic.EaseOut(this.timeLine.currentTime, 0f, IconBehaviour.SCALE_RATE_ANDROID, IconShowState.ANIMATION_TIME);
            float vfxScale = Quadratic.EaseOut(this.timeLine.currentTime, 0f, IconShowState.VFX_SCALE, IconShowState.ANIMATION_TIME);
            float rotate   = IconShowState.ROTATE_DEGREE - Quadratic.EaseOut(this.timeLine.currentTime, 0f, IconShowState.ROTATE_DEGREE, IconShowState.ANIMATION_TIME) - 180f;

            this.owner.transform.localScale           = new Vector3(scale, IconBehaviour.SCALE_RATE_ANDROID, scale);
            this.owner.transform.localRotation        = Quaternion.Euler(new Vector3(0, -1f * rotate, 0));
            this.owner.vortexVfx.transform.localScale = new Vector3(vfxScale, vfxScale, vfxScale);
            this.timeLine.Next();
            return;
        }
Ejemplo n.º 3
0
        internal static float Ease(Type ease, float t, float duration)
        {
            switch (ease)
            {
            case Type.Linear:
                return(Linear.EaseNone(t, duration));

            case Type.BackIn:
                return(Back.EaseIn(t, duration));

            case Type.BackOut:
                return(Back.EaseOut(t, duration));

            case Type.BackInOut:
                return(Back.EaseInOut(t, duration));

            case Type.BounceIn:
                return(Bounce.EaseIn(t, duration));

            case Type.BounceOut:
                return(Bounce.EaseOut(t, duration));

            case Type.BounceInOut:
                return(Bounce.EaseInOut(t, duration));

            case Type.CircIn:
                return(Circular.EaseIn(t, duration));

            case Type.CircOut:
                return(Circular.EaseOut(t, duration));

            case Type.CircInOut:
                return(Circular.EaseInOut(t, duration));

            case Type.CubicIn:
                return(Cubic.EaseIn(t, duration));

            case Type.CubicOut:
                return(Cubic.EaseOut(t, duration));

            case Type.CubicInOut:
                return(Cubic.EaseInOut(t, duration));

            case Type.ElasticIn:
                return(Elastic.EaseIn(t, duration));

            case Type.ElasticOut:
                return(Elastic.EaseOut(t, duration));

            case Type.ElasticInOut:
                return(Elastic.EaseInOut(t, duration));

            case Type.Punch:
                return(Elastic.Punch(t, duration));

            case Type.ExpoIn:
                return(Exponential.EaseIn(t, duration));

            case Type.ExpoOut:
                return(Exponential.EaseOut(t, duration));

            case Type.ExpoInOut:
                return(Exponential.EaseInOut(t, duration));

            case Type.QuadIn:
                return(Quadratic.EaseIn(t, duration));

            case Type.QuadOut:
                return(Quadratic.EaseOut(t, duration));

            case Type.QuadInOut:
                return(Quadratic.EaseInOut(t, duration));

            case Type.QuartIn:
                return(Quartic.EaseIn(t, duration));

            case Type.QuartOut:
                return(Quartic.EaseOut(t, duration));

            case Type.QuartInOut:
                return(Quartic.EaseInOut(t, duration));

            case Type.QuintIn:
                return(Quintic.EaseIn(t, duration));

            case Type.QuintOut:
                return(Quintic.EaseOut(t, duration));

            case Type.QuintInOut:
                return(Quintic.EaseInOut(t, duration));

            case Type.SineIn:
                return(Sinusoidal.EaseIn(t, duration));

            case Type.SineOut:
                return(Sinusoidal.EaseOut(t, duration));

            case Type.SineInOut:
                return(Sinusoidal.EaseInOut(t, duration));

            default:
                return(Linear.EaseNone(t, duration));
            }
        }