Loading...
Searching...
No Matches
AdventureHero.HeroClimbAction Class Reference

Detailed Description

action that starts itself when close to fitting colliders if the input is pushed towards the collider
while climbing the character moves along the selected collider, movement is limited by checking directional points
automatically ends when moving down if the character is grounded and the collider ends
can also finish in a pull up if the collider ends at the top and fitting ground is detected
only works with convex colliders because Physics.ClosestPoint(Vector3, Collider, Vector3, Quaternion) is used
climbing only works on one item at a time, multiple colliders can be used by combining them in a rigidbody

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

Inheritance diagram for AdventureHero.HeroClimbAction:
AdventureCore.ControllerActionBase AdventureCore.CharacterActionBase AdventureCore.IPlayAnimation AdventureCore.ICharacterAssociator

Public Member Functions

override string GetName ()
 
override void OnStart (CharacterActorBase actor, bool jumpStart=false)
 
override bool CanEnd (CharacterActionBase next)
 
override void OnEnd (CharacterActionBase next)
 
override void OnInput (bool parameter)
 
override void OnInput (Vector2 parameter)
 
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)
 
virtual bool CanStart (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 (int parameter)
 

Public Attributes

GenericTriggerArea TriggerArea
 
float Speed = 2f
 
float InputAngle = 30f
 
float CharacterDistance = 0.25f
 
Vector2 CheckSize = new Vector2(0.5f, 1.25f)
 
float CheckDistance = 1f
 
CharacterActionBase JumpAction
 
float JumpForce = 1f
 
LayerMask PullUpLayer = 1
 
float PullUpForward = 1f
 
float PullUpDown = 1f
 
float PullUpDistance = 0.45f
 
string EndMessage = "END"
 
- Public Attributes inherited from AdventureCore.ControllerActionBase
PlayableAnimationParameters Controller
 
- Public Attributes inherited from AdventureCore.CharacterActionBase
CharacterInstructionBase[] Instructions
 
CharacterActorBase Owner
 
CharacterActionInputType InputType
 
CharacterActionBase Next
 
UnityEvent< string > MessageReceived
 
MessageEvent[] MessageEvents
 
UnityEvent Starting
 
UnityEvent Ending
 

Properties

Vector3 CharacterCenter [get, set]
 
Vector3 CharacterTop [get]
 
Vector3 CharacterBottom [get]
 
Vector3 CharacterRight [get]
 
Vector3 CharacterLeft [get]
 
- Properties inherited from AdventureCore.ControllerActionBase
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 }
 
- Protected Member Functions inherited from AdventureCore.ControllerActionBase
override void OnDestroy ()
 
virtual void createAnimation ()
 
virtual void cancelAnimation ()
 
virtual void endAnimation (CharacterActionBase _)
 
virtual void onAnimationFinished (PlayableAnimation a)
 
override void setTrigger (int id)
 
override void setBool (int id, bool value)
 
override void setInt (int id, int value)
 
override void setFloat (int id, float value)
 
override void setState (int id)
 
- Protected Member Functions inherited from AdventureCore.CharacterActionBase
virtual void OnEnable ()
 
virtual void OnDisable ()
 
void onCanStartChanged ()
 
void onCanEndChanged ()
 
void addInstructions (IEnumerable< CharacterInstructionBase > instructions)
 
void removeInstructions (IEnumerable< CharacterInstructionBase > instructions)
 
void addInstruction (CharacterInstructionBase instruction)
 
void removeInstruction (CharacterInstructionBase instruction)
 
- Static Protected Member Functions inherited from AdventureCore.CharacterActionBase
static bool checkMessage (string parameter, string message)
 
- Protected Attributes inherited from AdventureCore.ControllerActionBase
PlayableAnimation _animation
 
- 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 AdventureHero.HeroClimbAction.CanEnd ( CharacterActionBase next)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ GetName()

override string AdventureHero.HeroClimbAction.GetName ( )
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ OnEnd()

override void AdventureHero.HeroClimbAction.OnEnd ( CharacterActionBase next)
inlinevirtual

◆ OnInput() [1/2]

override void AdventureHero.HeroClimbAction.OnInput ( bool parameter)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ OnInput() [2/2]

override void AdventureHero.HeroClimbAction.OnInput ( Vector2 parameter)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ OnMessage()

override void AdventureHero.HeroClimbAction.OnMessage ( string parameter)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ OnStart()

override void AdventureHero.HeroClimbAction.OnStart ( CharacterActorBase actor,
bool jumpStart = false )
inlinevirtual