Exemplo n.º 1
0
        public void TestLoopIndexWithNop()
        {
            Tween tween = new Tween().Delay(0.1f).Nop().Delay(0.1f).Nop().Delay(0.1f).Loop().Start();

            tween.DeltaUpdate(0.1f);
            Assert.AreEqual(tween.CurrentKeyFrameIndex, 2);
            tween.DeltaUpdate(0.1f);
            Assert.AreEqual(tween.CurrentKeyFrameIndex, 4);
            tween.DeltaUpdate(0.1f);
            Assert.AreEqual(tween.CurrentKeyFrameIndex, 0);
        }
Exemplo n.º 2
0
        public void TestDeltaUpdate()
        {
            this.genericValue = 0;
            Tween tween = new Tween();

            tween.To(this, new { genericValue = 173 }, 1);
            tween.To(this, new { genericValue = 26 }, 1);
            tween.Start();
            tween.DeltaUpdate(1);
            Assert.AreEqual(tween.CurrentKeyFrameIndex, 1);
            Assert.AreEqual(this.genericValue, 173);
            tween.DeltaUpdate(0.5f);
            Assert.AreEqual(tween.CurrentKeyFrameIndex, 1);
            Assert.AreEqual(this.genericValue, 99.5f);
            tween.DeltaUpdate(0.5f);
            Assert.AreEqual(tween.CurrentKeyFrameIndex, 1);
            Assert.AreEqual(this.genericValue, 26);
            tween.DeltaUpdate(0.5f);
            Assert.AreEqual(tween.CurrentKeyFrameIndex, 1);
            Assert.AreEqual(this.genericValue, 26);
        }