Inventory Engine
v3.8
|
This class lets you bind keys to specific slots in a target inventory, and associate an action to execute when that key is pressed. More...
Inherits MonoBehaviour.
Classes | |
class | InventoryInputActionsBindings |
A class used to store slot / key / action bindings More... | |
Public Types | |
enum | Actions { Actions.Equip, Actions.Use, Actions.Drop, Actions.Unequip } |
The possible actions that can be caused when activating input More... | |
Public Attributes | |
string | TargetInventoryName = "MainInventory" |
the name of the inventory to pilot with these bindings More... | |
string | PlayerID = "Player1" |
the unique ID of the Player associated to this component More... | |
List< InventoryInputActionsBindings > | InputBindings |
a list of bindings to go through when looking for input More... | |
Protected Member Functions | |
virtual void | Start () |
On Start we initialize our inventory reference More... | |
virtual void | Initialization () |
Makes sure we have a target inventory More... | |
virtual void | Update () |
On Update we look for input More... | |
virtual void | DetectInput () |
Every frame we look for input for each of our bindings More... | |
virtual void | ExecuteAction (InventoryInputActionsBindings binding) |
Executes the corresponding action for the specified binding More... | |
Protected Attributes | |
Inventory | _targetInventory = null |
Properties | |
Inventory | TargetInventory [get] |
Returns the target inventory of this component More... | |
This class lets you bind keys to specific slots in a target inventory, and associate an action to execute when that key is pressed.
A typical use case would be a weapon bar, where pressing 1 equips a gun, pressing 2 equips a shotgun, etc. Coincidentally, that's what the PixelRogueWeaponBar demo scene demonstrates.
|
protectedvirtual |
Every frame we look for input for each of our bindings
|
protectedvirtual |
Executes the corresponding action for the specified binding
binding |
ArgumentOutOfRangeException |
|
protectedvirtual |
Makes sure we have a target inventory
|
protectedvirtual |
On Start we initialize our inventory reference
|
protectedvirtual |
On Update we look for input
|
protected |
List<InventoryInputActionsBindings> MoreMountains.InventoryEngine.InventoryInputActions.InputBindings |
a list of bindings to go through when looking for input
string MoreMountains.InventoryEngine.InventoryInputActions.PlayerID = "Player1" |
the unique ID of the Player associated to this component
string MoreMountains.InventoryEngine.InventoryInputActions.TargetInventoryName = "MainInventory" |
the name of the inventory to pilot with these bindings
|
get |
Returns the target inventory of this component