Loading...
Searching...
No Matches
AdventureCore.CharacterActionBase Class Reference

Detailed Description

character actions are, very loosely, defined as anything a character does in the game
they typicall have a start and end and may only be started in the right circumstances
they are used to encapsulate some behaviour for a character which can then be put on the character itself or some other object it may interact with
for example a jump would be an action directly on a character, climbing a ladder or swinging a weapon are actions that are added to the pertaining object

https://adventure.softleitner.com/manual/acting

Inheritance diagram for AdventureCore.CharacterActionBase:
AdventureCore.ICharacterAssociator AdventureCore.ButtonAction AdventureCore.ControllerActionBase AdventureCore.GenericAction AdventureCore.MotionAction AdventureCore.NavApproachAction AdventureCore.NavPatrolAction AdventureCore.ObjectAction AdventureCore.PickupAction AdventureCore.TimedAction AdventureCore.TimelineAction AdventureCore.VisualScriptingAction AdventureHero.Assets.SoftLeitner.AdventureHero.Scripts.Actions.HeroHoldableAction AdventureHero.HeroCarryAction AdventureHero.HeroGuardAction AdventureSouls.SoulsBonfireAction AdventureSouls.SoulsCriticalAction AdventureSouls.SoulsCrittedAction AdventureSouls.SoulsLadderEnterAction AdventureSouls.SoulsParryAction AdventureSouls.SoulsRecoverAction AdventureSouls.SoulsRecoveryAction AdventureSouls.SoulsTalkAction AdventureSouls.SoulsTeleportAction AdventureSouls.SoulsTwoHandAction

Public Types

enum  CharacterActionInputType { Perform = 0 , PerformCancel = 1 , Start = 10 , StartCancel = 11 }
 

Public Member Functions

void BindInput (InputAction inputAction)
 
void UnbindInput (InputAction inputAction)
 
virtual void Input (InputAction.CallbackContext callbackContext)
 
virtual void Input (InputAction.CallbackContext callbackContext, CharacterActorBase actor)
 
virtual void InputClick (CharacterActorBase actor)
 
virtual void InputDown (CharacterActorBase actor)
 
virtual void InputUp (CharacterActorBase actor)
 
virtual bool CanStart (CharacterActorBase actor)
 
virtual void OnStart (CharacterActorBase actor, bool jumpStart=false)
 
virtual bool CanEnd (CharacterActionBase next)
 
virtual void OnEnd (CharacterActionBase next)
 
void StartAction ()
 overload of StartAction(bool, bool) without a return type so it can be found in event triggers in the inspector
 
bool StartAction (bool jumpStart=false, bool force=false)
 
virtual bool StartAction (CharacterActorBase actor, bool jumpStart=false, bool force=false)
 
virtual void EndAction ()
 
virtual void AddAction (CharacterActorBase actor)
 
virtual void RemoveAction (CharacterActorBase actor)
 
virtual void SendCharacterMessages (string e)
 
virtual void SendCharacterMessage (string e)
 
virtual void MoveCharacter (Transform transform)
 
virtual void OnMessage (string parameter)
 
virtual void OnInput (bool parameter)
 
virtual void OnInput (int parameter)
 
virtual void OnInput (Vector2 parameter)
 
virtual string GetName ()
 

Public Attributes

CharacterInstructionBase[] Instructions
 
CharacterActorBase Owner
 
CharacterActionInputType InputType
 
CharacterActionBase Next
 
UnityEvent< string > MessageReceived
 
MessageEvent[] MessageEvents
 
UnityEvent Starting
 
UnityEvent Ending
 

Protected Member Functions

virtual void OnDestroy ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void setTrigger (int id)
 
virtual void setBool (int id, bool value)
 
virtual void setInt (int id, int value)
 
virtual void setFloat (int id, float value)
 
virtual void setState (int id)
 
void onCanStartChanged ()
 
void onCanEndChanged ()
 
void addInstructions (IEnumerable< CharacterInstructionBase > instructions)
 
void removeInstructions (IEnumerable< CharacterInstructionBase > instructions)
 
void addInstruction (CharacterInstructionBase instruction)
 
void removeInstruction (CharacterInstructionBase instruction)
 

Protected Attributes

bool _isDestroyed = false
 

Properties

CharacterActorBase Actor [get]
 
CharacterBase AssociatedCharacter [get]
 character that owns or is otherwise associted with the object
 
virtual bool IsAvailable [get, set]
 IsAvailable asserts whether an action is availabel at all, even if it can't be started.
 
virtual bool IsHappening [get]
 whether the action is currently being executed
 
virtual bool IsHappeningWithNext [get]
 
- Properties inherited from AdventureCore.ICharacterAssociator

Events

Action< bool > IsAvailableChanged
 IsAvailable asserts whether an action is availabel at all, even if it can't be started.
 
Action< bool > IsHappeningChanged
 fired when the action starts and ends
 
Action< CharacterActionBaseCanStartChanged
 fired when whether the action can be started changes
 
Action< CharacterActionBaseCanEndChanged
 fired when whether the action can be ended changes
some actions can be ended before they end on their own(released motions for example)
 

Member Enumeration Documentation

◆ CharacterActionInputType

Enumerator
Perform 

InputActionPhase.Performed starts the action, for example pressing a button for jumping

PerformCancel 

InputActionPhase.Performed starts the action, InputActionPhase.Canceled ends it

Start 

InputActionPhase.Started starts the action

StartCancel 

InputActionPhase.Started starts the action, InputActionPhase.Canceled ends it
for example holding a button to guard with a shield

Property Documentation

◆ AssociatedCharacter

CharacterBase AdventureCore.CharacterActionBase.AssociatedCharacter
get

character that owns or is otherwise associted with the object

Implements AdventureCore.ICharacterAssociator.