Update() 공개 메소드

public Update ( ) : void
리턴 void
예제 #1
0
        public void SetAnimationAtEndTest()
        {
            var a = new Animator {
                TimeProvider = TimeProvider
            };
            var anim = SingleAnim(0, 0, 1).WatchPlayState(
                (playing) => {
                if (playing == false)
                {
                    a.SetAnimation(() => SingleAnim(1, 0, 1));
                }
            });

            a.SetAnimation(() => anim);

            a.Update();
            Assert.AreEqual(0, a.Group);
            Assert.AreEqual(0, a.Frame);

            a.Update();
            Assert.AreEqual(0, a.Group);
            Assert.AreEqual(1, a.Frame);

            a.Update();
            Assert.AreEqual(1, a.Group);
            Assert.AreEqual(0, a.Frame);
        }
예제 #2
0
        public void WaitForUpdateTest()
        {
            var a = new Animator {
                TimeProvider = TimeProvider
            };

            a.SetAnimation(WaitForUpdateAnim);

            a.Update();
            Assert.AreEqual(0, a.Frame);

            a.Update();
            Assert.AreEqual(1, a.Frame);

            a.Update();
            Assert.AreEqual(2, a.Frame);
        }
예제 #3
0
        public void AnimationSpeedTest()
        {
            var a = new Animator {
                TimeProvider = TimeProvider
            };

            a.SetAnimation(BasicAnimation);
            a.SetSpeed(2.0f);

            a.Update();
            Assert.AreEqual(0, a.Frame);

            TimeProvider.Advance(5);
            a.Update();
            Assert.AreEqual(0, a.Frame);

            TimeProvider.Advance(25);
            a.Update();
            Assert.AreEqual(1, a.Frame);

            TimeProvider.Advance(25);
            a.Update();
            Assert.AreEqual(2, a.Frame);

            TimeProvider.Advance(25);
            a.Update();
            Assert.AreEqual(0, a.Frame);

            a.SetSpeed(1.0f);

            TimeProvider.Advance(100);
            a.Update();
            Assert.AreEqual(2, a.Frame);
        }
예제 #4
0
        public void StringGroupTest()
        {
            var a = new Animator {
                TimeProvider = TimeProvider
            };

            a.SetAnimation(() => SingleAnim("group1", 0, 2));

            a.Update();
            Assert.AreEqual("group1", a.Group);
            Assert.AreEqual(0, a.Frame);

            TimeProvider.Advance(50);
            a.Update();
            Assert.AreEqual("group1", a.Group);
            Assert.AreEqual(1, a.Frame);

            TimeProvider.Advance(50);
            a.Update();
            Assert.AreEqual("group1", a.Group);
            Assert.AreEqual(2, a.Frame);
        }
예제 #5
0
        public void AnimationStringTest()
        {
            var a = new Animator {
                TimeProvider = TimeProvider
            };

            a.SetAnimation(AnimString1);

            a.Update();
            Assert.AreEqual(0, a.Group);

            TimeProvider.Advance(50);
            a.Update();
            Assert.AreEqual(1, a.Group);

            TimeProvider.Advance(50);
            a.Update();
            Assert.AreEqual(2, a.Group);

            TimeProvider.Advance(50);
            a.Update();
            Assert.AreEqual(0, a.Group);
        }
예제 #6
0
        public void ChainTest()
        {
            var a = new Animator {
                TimeProvider = TimeProvider
            };

            a.SetAnimation(() => SingleAnim(0, 0, 1).Chain(() => SingleAnim(1, 0, 1)));

            a.Update();
            Assert.AreEqual(0, a.Group);
            Assert.AreEqual(0, a.Frame);

            a.Update();
            Assert.AreEqual(0, a.Group);
            Assert.AreEqual(1, a.Frame);

            a.Update();
            Assert.AreEqual(1, a.Group);
            Assert.AreEqual(0, a.Frame);

            a.Update();
            Assert.AreEqual(1, a.Group);
            Assert.AreEqual(1, a.Frame);
        }