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

Detailed Description

a character action that represents a simple animation like jumping or rolling
when using TriggerName the animation has to send the START and END messages, RELEASE when Release is checked
CharacterAnimation can be used instead of triggering an animation on the characters animator, in this case START is not necessary and END is optional

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

Inheritance diagram for AdventureCore.MotionAction:
AdventureCore.CharacterActionBase AdventureCore.IPlayAnimation AdventureCore.ICharacterAssociator

Public Member Functions

override bool CanStart (CharacterActorBase actor)
 
override void OnStart (CharacterActorBase actor, bool jumpStart=false)
 
override bool CanEnd (CharacterActionBase next)
 
override void OnEnd (CharacterActionBase next)
 
override void OnMessage (string parameter)
 
- Public Member Functions inherited from AdventureCore.CharacterActionBase
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)
 
void ForceAction (bool jumpStart=false)
 convenience method for inspector events that calls StartAction(bool, bool) with force=true
 
void JumpStartAction (bool force=false)
 convenience method for inspector events that calls StartAction(bool, bool) with jumpStart=true
 
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 OnInput (bool parameter)
 
virtual void OnInput (int parameter)
 
virtual void OnInput (Vector2 parameter)
 
virtual string GetName ()
 

Public Attributes

string TriggerName
 
PlayableAnimationParameters CharacterAnimation
 
bool Release
 
bool AlignCharacter
 
Vector3 PropelCharacter
 
bool OnlyGrounded
 
ResourceQuantity[] Costs
 
string StartMessage = "START"
 
string ReleaseMessage = "RELEASE"
 
string EndMessage = "END"
 
- Public Attributes inherited from AdventureCore.CharacterActionBase
CharacterInstructionBase[] Instructions
 
CharacterActorBase Owner
 
CharacterActionInputType InputType
 
CharacterActionBase Next
 
UnityEvent< string > MessageReceived
 
MessageEvent[] MessageEvents
 
UnityEvent Starting
 
UnityEvent Ending
 

Protected Types

enum  ActionState {
  None , Triggered , Started , Released ,
  Ended
}
 internal enum for easier state management within the action
 

Protected Member Functions

virtual void setActionState (ActionState state)
 
virtual void onAnimationFinished (PlayableAnimation a)
 
- Protected Member Functions inherited from AdventureCore.CharacterActionBase
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)
 

Properties

PlayableAnimation PlayableAnimation [get]
 
Animator PlayableAnimationTarget [get]
 
- Properties inherited from AdventureCore.CharacterActionBase
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
- Properties inherited from AdventureCore.IPlayAnimation

Additional Inherited Members

- Public Types inherited from AdventureCore.CharacterActionBase
enum  CharacterActionInputType { Perform = 0 , PerformCancel = 1 , Start = 10 , StartCancel = 11 }
 
- Static Protected Member Functions inherited from AdventureCore.CharacterActionBase
static bool checkMessage (string parameter, string message)
 
- Protected Attributes inherited from AdventureCore.CharacterActionBase
bool _isDestroyed = false
 
- Events inherited from AdventureCore.CharacterActionBase
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 Function Documentation

◆ CanEnd()

override bool AdventureCore.MotionAction.CanEnd ( CharacterActionBase next)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ CanStart()

override bool AdventureCore.MotionAction.CanStart ( CharacterActorBase actor)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ OnEnd()

override void AdventureCore.MotionAction.OnEnd ( CharacterActionBase next)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ OnMessage()

override void AdventureCore.MotionAction.OnMessage ( string parameter)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ OnStart()

override void AdventureCore.MotionAction.OnStart ( CharacterActorBase actor,
bool jumpStart = false )
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

Property Documentation

◆ PlayableAnimation

PlayableAnimation AdventureCore.MotionAction.PlayableAnimation
get

◆ PlayableAnimationTarget

Animator AdventureCore.MotionAction.PlayableAnimationTarget
get