コード例 #1
0
    public static FancyPlayerActions Create()
    {
        var actions = new FancyPlayerActions();

        //keyboard bindings
        actions.StartGame.AddDefaultBinding(Key.Space);
        actions.Left.AddDefaultBinding(Key.A);
        actions.Left.AddDefaultBinding(Key.LeftArrow);
        actions.Right.AddDefaultBinding(Key.D);
        actions.Right.AddDefaultBinding(Key.RightArrow);
        actions.Escape.AddDefaultBinding(Key.Escape);

        //controller bindings
        actions.StartGame.AddDefaultBinding(InputControlType.Action1);
        actions.Left.AddDefaultBinding(InputControlType.LeftStickLeft);
        actions.Left.AddDefaultBinding(InputControlType.RightStickLeft);
        actions.Right.AddDefaultBinding(InputControlType.RightStickRight);
        actions.Right.AddDefaultBinding(InputControlType.LeftStickRight);
        actions.Escape.AddDefaultBinding(InputControlType.Start);

        return(actions);
    }
コード例 #2
0
 void Awake()
 {
     actions = FancyPlayerActions.Create();
 }