Esempio n. 1
0
        public bool crossFade(AnimationState m, float time = 0.3f, float targ = 1.0f)
        {
            if (!now.isSame(m))
            {
                pre.kill();

                pre = now;

                pre.startFadeOut(time);

                now = new MotionUnit2D(m, time, targ, false);
            }

            return(now.motionX.time >= now.motionX.length);
        }
Esempio n. 2
0
        public bool crossFade2D(AnimationState mX, AnimationState mY, Vector2 dir, float speed, float time = 0.3f, float targ = 1.0f)
        {
            if (!now.isSame(mX, mY))
            {
                pre.kill();

                pre = now;

                pre.startFadeOut(time);

                now = new MotionUnit2D(mX, mY, time, targ, true);
            }

            now.move(dir, speed);

            return(now.motionX.time >= now.motionX.length && now.motionY.time >= now.motionY.length);
        }