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);
    }
 public Roga2dAnimationSettings(Roga2dAnimationPlayer player, Roga2dNode root, Roga2dNode origin, Roga2dNode target, Roga2dCommandCallback commandCallBack)
 {
     this.player = player;
     this.root = root;
     this.origin = origin;
     this.Target = target;
     this.commandCallBack = commandCallBack;
 }
Example #3
0
        // Use this for initialization
        public TopWindow(MapModel mapModel)
        {
            Shader.WarmupAllShaders() ;

            this.mapModel = mapModel;
            this.animationPlayer = new Roga2dAnimationPlayer();
            this.root = new Roga2dNode("Root");
            this.AddChild(this.root);

            // animationPlayer
            this.player = spawnBattler("hose", 40, 30);
            this.root.AddChild(this.player);

            // Stage
            this.stage = new Stage();
            this.stage.LocalPriority = 0.0f;
            this.root.AddChild(stage);

            this.mapModel.StepMoved += this.onStepMoved;
            this.stage.ScrollFinished += this.onScrollFinished;
        }
    // Use this for initialization
    void Start()
    {
        Shader.WarmupAllShaders() ;

        this.player = new Roga2dAnimationPlayer();
        this.root = new Roga2dNode("Root");
        this.root.LocalScale = new Vector2(2.0f, 2.0f);
        Roga2dGameObjectState state = Roga2dUtils.stashState(this.root.Transform);
        this.root.Transform.parent = roga2dRoot.transform;
        Roga2dUtils.applyState(this.root.Transform, state);

        // Player
        this.root.AddChild(spawnBattler("pierre", 40, -20));
        this.root.AddChild(spawnBattler("amon", 40, 20));
        this.root.AddChild(spawnBattler("draco", 80, -40));
        this.root.AddChild(spawnBattler("lilia", 80, 0));
        this.root.AddChild(spawnBattler("hose", 80, 40));

        // Monster
        this.monster = spawnMonster("death_wind", -40, 0);
        this.root.AddChild(this.monster);

        // Stage
        Stage stage = new Stage();
        stage.LocalPriority = 0.0f;
        this.root.AddChild(stage);
    }