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

Detailed Description

action that fires a projectile from a slingshot
controls the slingshot model visibility and animation
adjusts character IK to align with target or camera direction
instantiates projectile and removes ammo when button is released

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

Inheritance diagram for AdventureHero.HeroSlingAction:
AdventureCore.ControllerActionBase AdventureHero.HeroPlayerCharacter.IHoldable AdventureCore.CharacterActionBase AdventureCore.IPlayAnimation AdventureCore.ICharacterAssociator

Public Member Functions

override void InputDown (CharacterActorBase actor)
 
override void InputUp (CharacterActorBase actor)
 
override bool CanEnd (CharacterActionBase next)
 
override void OnStart (CharacterActorBase actor, bool jumpStart=false)
 
override void OnEnd (CharacterActionBase next)
 
void Show (HeroPlayerCharacter player)
 
void Hide (HeroPlayerCharacter player)
 
- 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 bool CanStart (CharacterActorBase actor)
 
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

Animator Model
 
Transform ProjectileOrigin
 
Transform ProjectilePrefab
 
float Cooldown = 0f
 
bool AutoFirstPerson
 
ItemBase Ammo
 
- 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
 

Static Public Attributes

static int BounceParameter = Animator.StringToHash("Bounce")
 
static int PullParameter = Animator.StringToHash("Pull")
 

Protected Member Functions

override void OnDestroy ()
 
- Protected Member Functions inherited from AdventureCore.ControllerActionBase
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)
 

Additional Inherited Members

- Public Types inherited from AdventureCore.CharacterActionBase
enum  CharacterActionInputType { Perform = 0 , PerformCancel = 1 , Start = 10 , StartCancel = 11 }
 
- Protected Attributes inherited from AdventureCore.ControllerActionBase
PlayableAnimation _animation
 
- Protected Attributes inherited from AdventureCore.CharacterActionBase
bool _isDestroyed = false
 
- 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
- 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.HeroSlingAction.CanEnd ( CharacterActionBase next)
virtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ Hide()

void AdventureHero.HeroSlingAction.Hide ( HeroPlayerCharacter player)
inline

◆ InputDown()

override void AdventureHero.HeroSlingAction.InputDown ( CharacterActorBase actor)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ InputUp()

override void AdventureHero.HeroSlingAction.InputUp ( CharacterActorBase actor)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ OnDestroy()

override void AdventureHero.HeroSlingAction.OnDestroy ( )
inlineprotectedvirtual

◆ OnEnd()

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

◆ OnStart()

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

◆ Show()

void AdventureHero.HeroSlingAction.Show ( HeroPlayerCharacter player)
inline