public void TestTweener_OnComplete()
        {
            var   tweener = new AltoTweener();
            float value1  = 0;
            float value2  = 0;

            tweener.NewTween().FromTo(3f, 7f, 1.0f).OnUpdate(x => value1 = x)
            .OnComplete(x => value2 = x * 2);

            tweener.Update(0.9f);
            Assert.That(value2, Is.EqualTo(0));

            tweener.Update(0.3f);
            Assert.That(value2, Is.EqualTo(14f));
        }
        public void TestTweener_MethodChain()
        {
            var   tweener = new AltoTweener();
            float value   = 0;

            tweener.NewTween().FromTo(10f, 20f, 1.0f).OnUpdate(x => value = x);

            Assert.That(tweener.count, Is.EqualTo(1));
            Assert.That(value, Is.EqualTo(10f), "OnUpdate の時点で最初の update は呼ばれている");

            tweener.Update(0.1f);
            Assert.That(value, Is.EqualTo(11f));

            tweener.Update(0.9f);
            Assert.That(tweener.count, Is.EqualTo(0));
            Assert.That(value, Is.EqualTo(20f));
        }
        public void TestTweener_Delay()
        {
            var   tweener = new AltoTweener();
            float value1  = 0;

            tweener.NewTween().Delay(0.5f).FromTo(1f, 2f, 1.0f).OnUpdate(x => value1 = x);
            Assert.That(value1, Is.EqualTo(0f));

            tweener.Update(0.4f);
            Assert.That(value1, Is.EqualTo(0f));
            tweener.Update(0.1f);
            Assert.That(value1, Is.EqualTo(0f));
            tweener.Update(0.0001f);
            Assert.That(value1, Is.EqualTo(1f).Within(0.001f));
            tweener.Update(0.5f);
            Assert.That(value1, Is.EqualTo(1.5f).Within(0.001f));
            tweener.Update(0.8f);
            Assert.That(value1, Is.EqualTo(2f).Within(0.001f));
        }