public static void TestPlay()
    {
        GameObject gameObject = new GameObject();
        Roga2dAnimationPlayer player = new Roga2dAnimationPlayer();
        Roga2dWait interval = new Roga2dWait(3);
        Roga2dNode node = new Roga2dNode();
        Roga2dAnimation animation = Roga2dAnimation.Build(node, interval);
        player.Play(null, null, animation, AnimationFinished);

        Tester.Ok(!interval.IsDone());

        player.Update();
        Tester.Ok(!interval.IsDone());

        player.Update();
        Tester.Ok(!interval.IsDone());

        player.Update();
        Tester.Ok(!interval.IsDone());

        Tester.Match(testCounter, 0);

        player.Update();
        Tester.Ok(interval.IsDone());
        Tester.Match(testCounter, 999);

        node.Destroy();
        Object.Destroy(gameObject);
    }
Esempio n. 2
0
    public static void TestTween()
    {
        Roga2dWait interval = new Roga2dWait(5);

        Tester.Ok(!interval.IsDone());

        interval.Update();
        Tester.Ok(!interval.IsDone());

        interval.Update();
        Tester.Ok(!interval.IsDone());

        interval.Update();
        Tester.Ok(!interval.IsDone());

        interval.Update();
        Tester.Ok(!interval.IsDone());

        interval.Update();
        Tester.Ok(interval.IsDone());

        interval.Reset();
        Tester.Ok(!interval.IsDone());
    }