예제 #1
0
        public bool play(AnimationState m, float targ = 1.0f)
        {
            if (!now.isSame(m))
            {
                pre.kill();

                now.kill();

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

            return(now.motionX.time >= now.motionX.length);
        }
예제 #2
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);
        }
예제 #3
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);
        }
예제 #4
0
        public bool blend2D(AnimationState mX, AnimationState mY, Vector2 dir, float dirsMax, float speed, float time = 0.3f, float targ = 1.0f)
        // dir は正規化
        {
            if (!now.isSame(mX, mY))
            {
                pre.kill();

                pre = now;

                pre.stay();

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

            now.move(dir, speed);

            pre.antiMove(ref now, dirsMax);

            return(now.motionX.time >= now.motionX.length && now.motionY.time >= now.motionY.length);
        }
예제 #5
0
 public void antiMove(ref MotionUnit2D other, float dirsMax)
 {
     this.nowWeight = (dirsMax - (other.dirWeight.x + other.dirWeight.y)) * other.targetWeight;
 }