Пример #1
0
    public static MPlayerActions CreateWithDefaultBindings()
    {
        var playerActions = new MPlayerActions();

        //playerActions.Run.AddDefaultBinding (Key.Shift);
        //playerActions.Run.AddDefaultBinding (InputControlType.RightBumper);
        //playerActions.Run.AddDefaultBinding (InputControlType.LeftBumper);

        //playerActions.SwitchMode.AddDefaultBinding ( InputControlType.TouchPadButton );
        //playerActions.SwitchMode.AddDefaultBinding ( Key.Space );

        playerActions.Up.AddDefaultBinding(Key.W);
        playerActions.Down.AddDefaultBinding(Key.S);
        playerActions.Left.AddDefaultBinding(Key.A);
        playerActions.Right.AddDefaultBinding(Key.D);

        playerActions.Left.AddDefaultBinding(InputControlType.LeftStickLeft);
        playerActions.Right.AddDefaultBinding(InputControlType.LeftStickRight);
        playerActions.Up.AddDefaultBinding(InputControlType.LeftStickUp);
        playerActions.Down.AddDefaultBinding(InputControlType.LeftStickDown);

        playerActions.Left.AddDefaultBinding(InputControlType.DPadLeft);
        playerActions.Right.AddDefaultBinding(InputControlType.DPadRight);
        playerActions.Up.AddDefaultBinding(InputControlType.DPadUp);
        playerActions.Down.AddDefaultBinding(InputControlType.DPadDown);

        playerActions.Dash.AddDefaultBinding(Key.Space);
        playerActions.Dash.AddDefaultBinding(InputControlType.Action1);

        playerActions.Plant.AddDefaultBinding(Key.E);
        playerActions.Plant.AddDefaultBinding(InputControlType.Action2);

        playerActions.SwitchPlant.AddDefaultBinding(Key.Tab);
        playerActions.SwitchPlant.AddDefaultBinding(InputControlType.RightBumper);
        playerActions.SwitchPlant.AddDefaultBinding(InputControlType.LeftBumper);


        return(playerActions);
    }
Пример #2
0
 // Use this for initialization
 void Start()
 {
     m_pos           = transform.position;
     m_playerActions = MPlayerActions.CreateWithDefaultBindings();
 }