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

Detailed Description

base class for characters which are, in a way, the brain of the operation
characters are the central component that provide access to and coordinate all the other systems(attributes, resources, inventory, movement, actions)
they typically handle and redirect input or ai and posess a simple messaging system which is usually forwarded to actors and actions

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

Inheritance diagram for AdventureCore.CharacterBase:
AdventureCore.IDamageReceiver AdventureCore.ICharacterAssociator AdventureCore.CharacterBaseTyped< TActor, TMovement, TInventory > AdventureCore.AnimatedCharacterBase< TActor, TMovement, TInventory > AdventureSouls.SoulsCharacterBase< TActor, TMovement, TInventory >

Public Member Functions

virtual void SetTrigger (string name)
 
virtual void SetBoolTrue (string name)
 
virtual void SetBoolFalse (string name)
 
virtual void SetBool (string name, bool value)
 
virtual void SetIntZero (string name)
 
virtual void SetIntOne (string name)
 
virtual void SetInt (string name, int value)
 
virtual void SetFloat (string name, float value)
 
virtual void SetState (string name)
 
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)
 
virtual bool GetBool (string name)
 
virtual int GetInt (string name)
 
virtual float GetFloat (string name)
 
virtual bool GetBool (int id)
 
virtual int GetInt (int id)
 
virtual float GetFloat (int id)
 
virtual void OnAnimation (string e)
 default method for receiving messages from animators
 
virtual void ApplyRootMotion (Animator animator)
 default method for receiving root motion from animators, forwarded to movement
 
virtual void ApplyInverseKinematics (int layer)
 default method for receiving inverse kinematics
 
virtual CharacterActionBase GetAction (string name)
 retrieves an action that is known by its name
actions are usually known by being children of the main actor
 
virtual void OnMessages (string e)
 use when a single string has to be split into several messages
by default the parameter is split by spaces
 
virtual void OnMessage (string e)
 puts a message into the characters messaging pipeline
 
virtual void OnConfirm (InputAction.CallbackContext callbackContext)
 
virtual void Confirm ()
 
virtual void OnCancel (InputAction.CallbackContext callbackContext)
 
virtual void Cancel ()
 
void OnDirection (InputAction.CallbackContext callbackContext)
 
void OnDirection (InputValue value)
 
virtual void OnDirection (Vector2 value)
 
void AddInstructions (IEnumerable< CharacterInstructionBase > instructions)
 
void RemoveInstructions (IEnumerable< CharacterInstructionBase > instructions)
 
void AddInstruction (CharacterInstructionBase instruction)
 
void RemoveInstruction (CharacterInstructionBase instruction)
 
virtual bool PreDamageSend (IDamageSender sender, IDamageReceiver receiver)
 
virtual void OnDamageSend (DamageEvent e)
 
virtual void PostDamageSend (IDamageSender sender, IDamageReceiver receiver, List< DamageEvent > events)
 
virtual bool PreDamageReceive (IDamageSender sender, IDamageReceiver receiver)
 
virtual void OnDamageReceive (DamageEvent e)
 
virtual void PostDamageReceive (IDamageSender sender, IDamageReceiver receiver, List< DamageEvent > events)
 
virtual void Hide ()
 
virtual void Show ()
 
void Replace (GameObject prefab)
 
virtual string GetName ()
 

Static Public Member Functions

static CharacterBase GetCharacter (string key)
 
static CharacterBase GetCharacterByName (string name)
 

Public Attributes

Animator Animator
 
PersisterBase Persister
 
UnityEvent< string > MessageReceived
 
MessageEvent[] MessageEvents
 
ResourcePool ResourcePool
 
AttributePool AttributePool
 
EffectPool EffectPool
 
UnityEvent< DamageEventDamaging
 
UnityEvent< DamageEvent[]> Damaged
 

Protected Member Functions

virtual void Awake ()
 
virtual void Start ()
 
virtual void OnDestroy ()
 
virtual void refreshInstructions ()
 

Properties

virtual bool IsSendDamageSuspended [get, set]
 
virtual bool IsReceiveDamageSuspended [get, set]
 
virtual bool IsControlSuspended [get, set]
 
virtual Transform Root [get]
 
virtual Vector3 Position [get]
 
IReadOnlyList< CharacterInstructionBaseCurrentInstructions [get]
 
virtual CharacterActorBase ActorBase [get]
 
virtual MovementBase MovementBase [get]
 
virtual InventoryBase InventoryBase [get]
 
CharacterBase AssociatedCharacter [get]
 character that owns or is otherwise associted with the object
 
static IReadOnlyList< CharacterBaseCharacters [get]
 
- Properties inherited from AdventureCore.ICharacterAssociator

Events

Action< int > ApplyingIK
 
Action Destroyed
 
static Action< CharacterBaseCharacterAdded
 
static Action< CharacterBaseCharacterRemoved
 

Member Function Documentation

◆ ApplyInverseKinematics()

virtual void AdventureCore.CharacterBase.ApplyInverseKinematics ( int layer)
inlinevirtual

default method for receiving inverse kinematics

Parameters
layer

◆ ApplyRootMotion()

virtual void AdventureCore.CharacterBase.ApplyRootMotion ( Animator animator)
virtual

default method for receiving root motion from animators, forwarded to movement

Parameters
animator

◆ GetAction()

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

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

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

◆ OnAnimation()

virtual void AdventureCore.CharacterBase.OnAnimation ( string e)
virtual

default method for receiving messages from animators

Parameters
e

◆ OnMessage()

virtual void AdventureCore.CharacterBase.OnMessage ( string e)
inlinevirtual

puts a message into the characters messaging pipeline

Parameters
e

◆ OnMessages()

virtual void AdventureCore.CharacterBase.OnMessages ( string e)
inlinevirtual

use when a single string has to be split into several messages
by default the parameter is split by spaces

Parameters
e

Property Documentation

◆ AssociatedCharacter

CharacterBase AdventureCore.CharacterBase.AssociatedCharacter
get

character that owns or is otherwise associted with the object

Implements AdventureCore.ICharacterAssociator.