

A mod designed to make creating player actions simpler.
Register an action with PlayerActionManager.RegisterPlayerAction() in your mod's awake function.
Access that action with player.data.playerActions.GetPlayerAction() in your mod.
ReadOnlyDictionary<string, ActionInfo> RegisteredActions { get; }
A list of all actions registered so far.
class ActionInfo
ActionInfo ActionInfo(string name, BindingSource keyboardlayout = null, BindingSource controllerLayout = null)
Creates a set of information for usage in binding player actions.
name The name for the action.keyboardlayout An optional parameter for setting the default keyboard layout.controllerLayout An optional parameter for setting the default controller layout.PlayerActionManager.RegisterPlayerAction(new ActionInfo("ToggleFlight", new KeyBindingSource(Key.Key1), new DeviceBindingSource(InputControlType.Action3)));
void RegisterPlayerAction(ActionInfo actionInfo)
Registers an action to be automatically generated for players.
NOTE: You should only be registering actions in your mod's awake function. If you register them any later, they will not show in rebind controls.
actionInfo the details of the action to be registered.PlayerActionManager.RegisterPlayerAction(new ActionInfo("ToggleFlight", new KeyBindingSource(Key.Key1), new DeviceBindingSource(InputControlType.Action3)));
PlayerAction GetPlayerAction(this PlayerActions playerActions, string name)
Returns a registered PlayerAction that has been created for the player. Returns null if the action doesn't exist.
name the name of the registered action.player.data.playerActions.GetPlayerAction(name);
bool ActionWasPressed(this PlayerActions playerActions, string name)
Returns whether a registered action was pressed. Returns false if the action doesn't exist.
Note that this is an alternative to fetching the action and then checking the PlayerAction::WasPressed property.
name the name of the registered action.player.data.playerActions.ActionWasPressed(name);
bool ActionIsPressed(this PlayerActions playerActions, string name)
Returns whether a registered action is pressed. Returns false if the action doesn't exist.
Note that this is an alternative to fetching the action and then checking the PlayerAction::IsPressed property.
name the name of the registered action.player.data.playerActions.ActionIsPressed(name);
bool ActionWasReleased(this PlayerActions playerActions, string name)
Returns whether a registered action was released. Returns false if the action doesn't exist.
Note that this is an alternative to fetching the action and then checking the PlayerAction::WasReleased property.
name the name of the registered action.player.data.playerActions.ActionWasReleased(name);