Loading...
Searching...
No Matches
AdventureCore.CharacterActorBase Class Referenceabstract

Detailed Description

base class for character actors
these actors manage how and when exactly actions can start, are started and ended

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

Inheritance diagram for AdventureCore.CharacterActorBase:
AdventureCore.ICharacterAssociator AdventureCore.SerialCharacterActor AdventureCore.BufferedCharacterActor AdventureCore.MinimalCharacterActor AdventureCore.TargetCharacterActor

Public Member Functions

virtual bool StartAction (string name, bool jumpStart=false, bool force=false)
 attempts to start or queue up an action
 
virtual void EndAction (string name)
 ends an action and removes it from the actors current actions usually called by actions and actors as they are in control of their progress
 
virtual void AddAction (string name)
 adds a continuing action
depending on the actor an added action can be interrupted
by a regular action or just be kept running in parallel
 
virtual void RemoveAction (string name)
 dicontinues an action added by AddAction(CharacterActionBase)
 
bool StartAction (CharacterActionBase characterAction, bool jumpStart=false, bool force=false)
 attempts to start or queue up an action
 
void EndAction (CharacterActionBase characterAction)
 ends an action and removes it from the actors current actions usually called by actions and actors as they are in control of their progress
 
void AddAction (CharacterActionBase characterAction)
 adds a continuing action
depending on the actor an added action can be interrupted
by a regular action or just be kept running in parallel
 
void RemoveAction (CharacterActionBase characterAction)
 dicontinues an action added by AddAction(CharacterActionBase)
 
virtual CharacterActionBase GetAction (string name)
 retrieves an action that is known by its name
actions are usually known by being children of the actor
 
virtual void OnMessage (string parameter)
 
virtual void OnInput (bool parameter)
 
virtual void OnInput (int parameter)
 
virtual void OnInput (Vector2 parameter)
 

Public Attributes

CharacterBase Character
 
UnityEvent< CharacterActionBaseActionStarted
 
UnityEvent< CharacterActionBaseActionEnded
 
UnityEvent ActionsChanged
 

Protected Member Functions

virtual void onActionStarted (CharacterActionBase characterAction)
 
virtual void onActionEnded (CharacterActionBase characterAction)
 
virtual void onActionsChanged ()
 

Properties

bool IsActing [get]
 
IEnumerable< CharacterActionBaseCurrentActions [get]
 
Dictionary< string, CharacterActionBaseChildActions [get]
 
bool InputBool [get]
 
int InputInt [get]
 
Vector2 InputVector [get]
 
CharacterBase AssociatedCharacter [get]
 character that owns or is otherwise associted with the object
 
- Properties inherited from AdventureCore.ICharacterAssociator

Member Function Documentation

◆ AddAction() [1/2]

void AdventureCore.CharacterActorBase.AddAction ( CharacterActionBase characterAction)
abstract

adds a continuing action
depending on the actor an added action can be interrupted
by a regular action or just be kept running in parallel

Parameters
characterAction

◆ AddAction() [2/2]

virtual void AdventureCore.CharacterActorBase.AddAction ( string name)
virtual

adds a continuing action
depending on the actor an added action can be interrupted
by a regular action or just be kept running in parallel

Parameters
namename of the action to start(action has to be known to the actor by being a child of it for example)

◆ EndAction() [1/2]

void AdventureCore.CharacterActorBase.EndAction ( CharacterActionBase characterAction)
abstract

ends an action and removes it from the actors current actions usually called by actions and actors as they are in control of their progress

Parameters
characterAction

◆ EndAction() [2/2]

virtual void AdventureCore.CharacterActorBase.EndAction ( string name)
virtual

ends an action and removes it from the actors current actions usually called by actions and actors as they are in control of their progress

Parameters
namename of the action to start(action has to be known to the actor by being a child of it for example)

◆ GetAction()

virtual CharacterActionBase AdventureCore.CharacterActorBase.GetAction ( string name)
virtual

retrieves an action that is known by its name
actions are usually known by being children of the actor

Parameters
namename of the action to retrieve
Returns
the action that was found by the name, if any

◆ RemoveAction() [1/2]

void AdventureCore.CharacterActorBase.RemoveAction ( CharacterActionBase characterAction)
abstract

dicontinues an action added by AddAction(CharacterActionBase)

Parameters
characterAction

◆ RemoveAction() [2/2]

virtual void AdventureCore.CharacterActorBase.RemoveAction ( string name)
virtual

dicontinues an action added by AddAction(CharacterActionBase)

Parameters
namename of the action to start(action has to be known to the actor by being a child of it for example)

◆ StartAction() [1/2]

bool AdventureCore.CharacterActorBase.StartAction ( CharacterActionBase characterAction,
bool jumpStart = false,
bool force = false )
abstract

attempts to start or queue up an action

Parameters
characterActionthe action to start
jumpStartaction should jump to its end
forcestart action immediately regardless of current actions
Returns
whether the action has actually been started or at last sheduled

◆ StartAction() [2/2]

virtual bool AdventureCore.CharacterActorBase.StartAction ( string name,
bool jumpStart = false,
bool force = false )
virtual

attempts to start or queue up an action

Parameters
namename of the action to start(action has to be known to the actor by being a child of it for example)
jumpStartaction should jump to its end
forcestart action immediately regardless of current actions
Returns
whether the action has actually been started or at last sheduled

Property Documentation

◆ AssociatedCharacter

CharacterBase AdventureCore.CharacterActorBase.AssociatedCharacter
get

character that owns or is otherwise associted with the object

Implements AdventureCore.ICharacterAssociator.