TopDown Engine v4.5
Loading...
Searching...
No Matches
MoreMountains.TopDownEngine.CharacterHandleSecondaryWeapon Class Reference

Add this class to a character so it can use weapons Note that this component will trigger animations (if their parameter is present in the Animator), based on the current weapon's Animations Animator parameters : defined from the Weapon's inspector. More...

Inheritance diagram for MoreMountains.TopDownEngine.CharacterHandleSecondaryWeapon:
MoreMountains.TopDownEngine.CharacterHandleWeapon MoreMountains.TopDownEngine.CharacterAbility MoreMountains.TopDownEngine.TopDownMonoBehaviour MoreMountains.Tools.MMMonoBehaviour

Protected Member Functions

override void HandleInput ()
 Gets input and triggers methods based on what's been pressed.
Protected Member Functions inherited from MoreMountains.TopDownEngine.CharacterHandleWeapon
override void PreInitialization ()
 Sets the weapon attachment.
override void Initialization ()
 Gets and stores components for further use.
virtual void HandleCharacterState ()
 Checks character state and stops shooting if not in normal state.
virtual void HandleFeedbacks ()
 Triggers the weapon used feedback if needed.
override void HandleInput ()
 Gets input and triggers methods based on what's been pressed.
virtual void HandleBuffer ()
 Triggers an attack if the weapon is idle and an input has been buffered.
virtual void ExtendBuffer ()
 Extends the duration of the buffer if needed.
virtual void InstantiateWeapon (Weapon newWeapon, string weaponID, bool combo=false)
 Instantiates the specified weapon.
virtual void HandleWeaponAim ()
 Applies aim if possible.
virtual void HandleWeaponIK ()
 Sets IK handles if needed.
virtual void HandleWeaponModel (Weapon newWeapon, string weaponID, bool combo=false, Weapon weapon=null)
override void InitializeAnimatorParameters ()
 Adds required animator parameters to the animator parameters list if they exist.
override void OnHit ()
 Override this to describe what should happen to this ability when the character takes a hit.
override void OnDeath ()
 Override this to describe what should happen to this ability when the character respawns.
override void OnRespawn ()
 Override this to describe what should happen to this ability when the character respawns.
Protected Member Functions inherited from MoreMountains.TopDownEngine.CharacterAbility
virtual void Awake ()
 On awake we proceed to pre initializing our ability.
virtual void Start ()
 On Start(), we call the ability's intialization.
virtual void BindAnimator ()
 Binds the animator from the character and initializes the animator parameters.
virtual void InternalHandleInput ()
 Internal method to check if an input manager is present or not.
virtual void RegisterAnimatorParameter (string parameterName, AnimatorControllerParameterType parameterType, out int parameter)
 Registers a new animator parameter to the list.
virtual void OnEnable ()
 On enable, we bind our respawn delegate.
virtual void OnDisable ()
 On disable, we unbind our respawn delegate.

Properties

override int HandleWeaponID [get]
Properties inherited from MoreMountains.TopDownEngine.CharacterHandleWeapon
virtual int HandleWeaponID [get]
virtual Animator CharacterAnimator [get, set]
 an animator to update when the weapon is used
virtual WeaponAim WeaponAimComponent [get]
 the weapon's weapon aim component, if it has one
Properties inherited from MoreMountains.TopDownEngine.CharacterAbility
virtual bool AbilityAuthorized [get]
virtual bool AbilityInitialized [get]
 whether or not this ability has been initialized

Additional Inherited Members

Public Member Functions inherited from MoreMountains.TopDownEngine.CharacterHandleWeapon
override string HelpBoxText ()
 This method is only used to display a helpbox text at the beginning of the ability's inspector.
delegate void OnWeaponChangeDelegate ()
virtual void Setup ()
 Grabs various components and inits stuff.
override void ProcessAbility ()
 Every frame we check if it's needed to update the ammo display.
virtual void ShootStart ()
 Causes the character to start shooting.
virtual void ShootStop ()
 Causes the character to stop shooting.
virtual void ForceStop ()
 Forces the weapon to stop.
virtual void Reload ()
 Reloads the weapon.
virtual void ChangeWeapon (Weapon newWeapon, string weaponID, bool combo=false)
 Changes the character's current weapon to the one passed as a parameter.
override void Flip ()
 Flips the current weapon if needed.
virtual void UpdateAmmoDisplay ()
 Updates the ammo display bar and text.
override void UpdateAnimator ()
 Override this to send parameters to the character's animator. This is called once per cycle, by the Character class, after Early, normal and Late process().
Public Member Functions inherited from MoreMountains.TopDownEngine.CharacterAbility
delegate void AbilityEvent ()
virtual void ForceInitialization ()
 Call this any time you want to force this ability to initialize (again)
virtual void ResetInput ()
 Resets all input for this ability. Can be overridden for ability specific directives.
virtual void EarlyProcessAbility ()
 The first of the 3 passes you can have in your ability. Think of it as EarlyUpdate() if it existed.
virtual void LateProcessAbility ()
 The last of the 3 passes you can have in your ability. Think of it as LateUpdate()
virtual void PermitAbility (bool abilityPermitted)
 Changes the status of the ability's permission.
virtual void ResetAbility ()
 Override this to reset this ability's parameters. It'll be automatically called when the character gets killed, in anticipation for its respawn.
virtual void SetInputManager (InputManager newInputManager)
 Changes the reference to the input manager with the one set in parameters.
virtual void PlayAbilityStartSfx ()
 Plays the ability start sound effect.
virtual void PlayAbilityUsedSfx ()
 Plays the ability used sound effect.
virtual void StopAbilityUsedSfx ()
 Stops the ability used sound effect.
virtual void PlayAbilityStopSfx ()
 Plays the ability stop sound effect.
virtual void PlayAbilityStartFeedbacks ()
 Plays the ability start sound effect.
virtual void StopStartFeedbacks ()
 Stops the ability used sound effect.
virtual void PlayAbilityStopFeedbacks ()
 Plays the ability stop sound effect.
Public Attributes inherited from MoreMountains.TopDownEngine.CharacterHandleWeapon
Weapon InitialWeapon
 the initial weapon owned by the character
bool CanPickupWeapons = true
 if this is set to true, the character can pick up PickableWeapons
MMFeedbacks WeaponUseFeedback
 a feedback that gets triggered at the character level everytime the weapon is used
Transform WeaponAttachment
 the position the weapon will be attached to. If left blank, will be this.transform.
Transform ProjectileSpawn
 the position from which projectiles will be spawned (can be safely left empty)
bool AutomaticallyBindAnimator = true
 if this is true this animator will be automatically bound to the weapon
int AmmoDisplayID = 0
 the ID of the AmmoDisplay this ability should update
bool AutoIK = true
 if this is true, IK will be automatically setup if possible
bool ContinuousPress = false
 if this is true you won't have to release your fire button to auto reload
bool GettingHitInterruptsAttack = false
 whether or not this character getting hit should interrupt its attack (will only work if the weapon is marked as interruptable)
bool UseSecondaryAxisThresholdToShoot = false
 whether or not pushing the secondary axis above its threshold should cause the weapon to shoot
bool ForceWeaponAimControl = false
 if this is true, the ForcedWeaponAimControl mode will be applied to all weapons equipped by this character
WeaponAim.AimControls ForcedWeaponAimControl = WeaponAim.AimControls.PrimaryMovement
 if ForceWeaponAimControl is true, the AimControls mode to apply to all weapons equipped by this character
bool ForceAlwaysShoot = false
 if this is true, the character will continuously fire its weapon
bool BufferInput
 whether or not attack input should be buffered, letting you prepare an attack while another is being performed, making it easier to chain them
bool NewInputExtendsBuffer
 if this is true, every new input will prolong the buffer
float MaximumBufferDuration = 0.25f
 the maximum duration for the buffer, in seconds
bool RequiresPerfectTile = false
 if this is true, and if this character is using GridMovement, then input will only be triggered when on a perfect tile
Weapon CurrentWeapon
 the weapon currently equipped by the Character
OnWeaponChangeDelegate OnWeaponChange
 a delegate you can hook to, to be notified of weapon changes
Public Attributes inherited from MoreMountains.TopDownEngine.CharacterAbility
AudioClip AbilityStartSfx
 the sound fx to play when the ability starts
AudioClip AbilityInProgressSfx
 the sound fx to play while the ability is running
AudioClip AbilityStopSfx
 the sound fx to play when the ability stops
MMFeedbacks AbilityStartFeedbacks
 the feedbacks to play when the ability starts
MMFeedbacks AbilityStopFeedbacks
 the feedbacks to play when the ability stops
bool AbilityPermitted = true
 if true, this ability can perform as usual, if not, it'll be ignored. You can use this to unlock abilities over time for example
CharacterStates.MovementStates[] BlockingMovementStates
 an array containing all the blocking movement states. If the Character is in one of these states and tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while Idle or Swimming, for example.
CharacterStates.CharacterConditions[] BlockingConditionStates
 an array containing all the blocking condition states. If the Character is in one of these states and tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while dead, for example.
Weapon.WeaponStates[] BlockingWeaponStates
 an array containing all the blocking weapon states. If one of the character's weapons is in one of these states and yet the character tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while attacking, for example.
AbilityEvent OnAbilityStart
AbilityEvent OnAbilityStop
Protected Attributes inherited from MoreMountains.TopDownEngine.CharacterHandleWeapon
float _fireTimer = 0f
float _secondaryHorizontalMovement
float _secondaryVerticalMovement
WeaponAim _weaponAim
ProjectileWeapon _projectileWeapon
WeaponIK _weaponIK
Transform _leftHandTarget = null
Transform _rightHandTarget = null
float _bufferEndsAt = 0f
bool _buffering = false
int _weaponEquippedAnimationParameter
int _weaponEquippedIDAnimationParameter
CharacterGridMovement _characterGridMovement
List< WeaponModel_weaponModels
Protected Attributes inherited from MoreMountains.TopDownEngine.CharacterAbility
Character _character
TopDownController _controller
TopDownController2D _controller2D
TopDownController3D _controller3D
GameObject _model
Health _health
CharacterMovement _characterMovement
InputManager _inputManager
Animator _animator = null
CharacterStates _state
SpriteRenderer _spriteRenderer
MMStateMachine< CharacterStates.MovementStates_movement
MMStateMachine< CharacterStates.CharacterConditions_condition
AudioSource _abilityInProgressSfx
bool _abilityInitialized = false
float _verticalInput
float _horizontalInput
bool _startFeedbackIsPlaying = false
List< CharacterHandleWeapon_handleWeaponList
Static Protected Attributes inherited from MoreMountains.TopDownEngine.CharacterHandleWeapon
const string _weaponEquippedAnimationParameterName = "WeaponEquipped"
const string _weaponEquippedIDAnimationParameterName = "WeaponEquippedID"

Detailed Description

Add this class to a character so it can use weapons Note that this component will trigger animations (if their parameter is present in the Animator), based on the current weapon's Animations Animator parameters : defined from the Weapon's inspector.

Member Function Documentation

◆ HandleInput()

override void MoreMountains.TopDownEngine.CharacterHandleSecondaryWeapon.HandleInput ( )
protectedvirtual

Gets input and triggers methods based on what's been pressed.

Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.

Property Documentation

◆ HandleWeaponID

override int MoreMountains.TopDownEngine.CharacterHandleSecondaryWeapon.HandleWeaponID
get

the ID / index of this CharacterHandleWeapon. This will be used to determine what handle weapon ability should equip a weapon. If you create more Handle Weapon abilities, make sure to override and increment this


The documentation for this class was generated from the following file: