Beispiel #1
0
    void Start()
    {
        Player player = EntityFactory.Create <Player, string>("model");

        Game.Scene.AddChild(player);
        InputComponent input = ComponentFactory.CreateWithEntity <InputComponent, string, string>(Game.Scene, "GameInputControl", "KeyBordControl");

        input.onStarted += (ctx) =>
        {
            player.GetComponent <Live2dComponent>().PlayAnimation("Walk");
        };

        input.onPerformed += (ctx) =>
        {
            player.GetComponent <Live2dComponent>().PlayAnimation("Run");
        };

        input.onCanceled += (ctx) =>
        {
            player.GetComponent <Live2dComponent>().PlayAnimation("Idle");
        };
    }