Corgi Engine  v8.8
MoreMountains.InventoryEngine.InventoryInputActions Class Reference

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. More...

Inheritance diagram for MoreMountains.InventoryEngine.InventoryInputActions:

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< InventoryInputActionsBindingsInputBindings
 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...
 

Detailed Description

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.

Member Enumeration Documentation

◆ Actions

The possible actions that can be caused when activating input

Enumerator
Equip 
Use 
Drop 
Unequip 

Member Function Documentation

◆ DetectInput()

virtual void MoreMountains.InventoryEngine.InventoryInputActions.DetectInput ( )
protectedvirtual

Every frame we look for input for each of our bindings

◆ ExecuteAction()

virtual void MoreMountains.InventoryEngine.InventoryInputActions.ExecuteAction ( InventoryInputActionsBindings  binding)
protectedvirtual

Executes the corresponding action for the specified binding

Parameters
binding
Exceptions
ArgumentOutOfRangeException

◆ Initialization()

virtual void MoreMountains.InventoryEngine.InventoryInputActions.Initialization ( )
protectedvirtual

Makes sure we have a target inventory

◆ Start()

virtual void MoreMountains.InventoryEngine.InventoryInputActions.Start ( )
protectedvirtual

On Start we initialize our inventory reference

◆ Update()

virtual void MoreMountains.InventoryEngine.InventoryInputActions.Update ( )
protectedvirtual

On Update we look for input

Member Data Documentation

◆ _targetInventory

Inventory MoreMountains.InventoryEngine.InventoryInputActions._targetInventory = null
protected

◆ InputBindings

List<InventoryInputActionsBindings> MoreMountains.InventoryEngine.InventoryInputActions.InputBindings

a list of bindings to go through when looking for input

◆ PlayerID

string MoreMountains.InventoryEngine.InventoryInputActions.PlayerID = "Player1"

the unique ID of the Player associated to this component

◆ TargetInventoryName

string MoreMountains.InventoryEngine.InventoryInputActions.TargetInventoryName = "MainInventory"

the name of the inventory to pilot with these bindings

Property Documentation

◆ TargetInventory

Inventory MoreMountains.InventoryEngine.InventoryInputActions.TargetInventory
get

Returns the target inventory of this component


The documentation for this class was generated from the following file: