Corgi Engine  v8.8
MoreMountains.CorgiEngine.CharacterSwapManager Class Reference

Add this class to an empty component in your scene, and it'll allow you to swap characters in your scene when pressing the SwapButton (P, by default) Each character in your scene will need to have a CharacterSwap class on it, and the corresponding PlayerID. You can see an example of such a setup in the MinimalCharacterSwap demo scene More...

Inheritance diagram for MoreMountains.CorgiEngine.CharacterSwapManager:
MoreMountains.CorgiEngine.CorgiMonoBehaviour MoreMountains.Tools.MMEventListener< CorgiEngineEvent >

Public Member Functions

virtual void UpdateList ()
 Grabs all CharacterSwap equipped characters in the scene and stores them in a list, sorted by Order More...
 
virtual void SwapCharacter ()
 Changes the current character to the next one in line More...
 
virtual int GetCurrentIndex ()
 Finds which character is currently active and considered the current one More...
 
virtual void OnMMEvent (CorgiEngineEvent engineEvent)
 On Level Start, we initialize our list More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< CorgiEngineEvent >
void OnMMEvent (T eventType)
 

Public Attributes

string SwapButtonName = "Player1_SwapCharacter"
 the name of the axis to use to catch input and trigger a swap on press More...
 
string PlayerID = "Player1"
 the PlayerID set on the Characters you want to swap between More...
 

Protected Member Functions

virtual void Update ()
 On Update, we watch for input More...
 
virtual void HandleInput ()
 If the user presses the Swap button, we swap characters More...
 
virtual void OnEnable ()
 On enable we start listening for events More...
 
virtual void OnDisable ()
 On disable we stop listening for events More...
 

Protected Attributes

CharacterSwap[] _characterSwapArray
 
MMCircularList< CharacterSwap_characterSwapList
 
CorgiEngineEvent _swapEvent = new CorgiEngineEvent(CorgiEngineEventTypes.CharacterSwap)
 

Detailed Description

Add this class to an empty component in your scene, and it'll allow you to swap characters in your scene when pressing the SwapButton (P, by default) Each character in your scene will need to have a CharacterSwap class on it, and the corresponding PlayerID. You can see an example of such a setup in the MinimalCharacterSwap demo scene

Member Function Documentation

◆ GetCurrentIndex()

virtual int MoreMountains.CorgiEngine.CharacterSwapManager.GetCurrentIndex ( )
virtual

Finds which character is currently active and considered the current one

Returns

◆ HandleInput()

virtual void MoreMountains.CorgiEngine.CharacterSwapManager.HandleInput ( )
protectedvirtual

If the user presses the Swap button, we swap characters

◆ OnDisable()

virtual void MoreMountains.CorgiEngine.CharacterSwapManager.OnDisable ( )
protectedvirtual

On disable we stop listening for events

◆ OnEnable()

virtual void MoreMountains.CorgiEngine.CharacterSwapManager.OnEnable ( )
protectedvirtual

On enable we start listening for events

◆ OnMMEvent()

virtual void MoreMountains.CorgiEngine.CharacterSwapManager.OnMMEvent ( CorgiEngineEvent  engineEvent)
virtual

On Level Start, we initialize our list

Parameters
eventType

◆ SwapCharacter()

virtual void MoreMountains.CorgiEngine.CharacterSwapManager.SwapCharacter ( )
virtual

Changes the current character to the next one in line

◆ Update()

virtual void MoreMountains.CorgiEngine.CharacterSwapManager.Update ( )
protectedvirtual

On Update, we watch for input

◆ UpdateList()

virtual void MoreMountains.CorgiEngine.CharacterSwapManager.UpdateList ( )
virtual

Grabs all CharacterSwap equipped characters in the scene and stores them in a list, sorted by Order

Member Data Documentation

◆ _characterSwapArray

CharacterSwap [] MoreMountains.CorgiEngine.CharacterSwapManager._characterSwapArray
protected

◆ _characterSwapList

MMCircularList<CharacterSwap> MoreMountains.CorgiEngine.CharacterSwapManager._characterSwapList
protected

◆ _swapEvent

CorgiEngineEvent MoreMountains.CorgiEngine.CharacterSwapManager._swapEvent = new CorgiEngineEvent(CorgiEngineEventTypes.CharacterSwap)
protected

◆ PlayerID

string MoreMountains.CorgiEngine.CharacterSwapManager.PlayerID = "Player1"

the PlayerID set on the Characters you want to swap between

◆ SwapButtonName

string MoreMountains.CorgiEngine.CharacterSwapManager.SwapButtonName = "Player1_SwapCharacter"

the name of the axis to use to catch input and trigger a swap on press


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