TopDown Engine
v4.1
|
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...
Public Member Functions | |
override string | HelpBoxText () |
This method is only used to display a helpbox text at the beginning of the ability's inspector. More... | |
delegate void | OnWeaponChangeDelegate () |
virtual void | Setup () |
Grabs various components and inits stuff More... | |
override void | ProcessAbility () |
Every frame we check if it's needed to update the ammo display More... | |
virtual void | ShootStart () |
Causes the character to start shooting More... | |
virtual void | ShootStop () |
Causes the character to stop shooting More... | |
virtual void | ForceStop () |
Forces the weapon to stop More... | |
virtual void | Reload () |
Reloads the weapon More... | |
virtual void | ChangeWeapon (Weapon newWeapon, string weaponID, bool combo=false) |
Changes the character's current weapon to the one passed as a parameter More... | |
override void | Flip () |
Flips the current weapon if needed More... | |
virtual void | UpdateAmmoDisplay () |
Updates the ammo display bar and text. More... | |
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(). More... | |
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) More... | |
virtual void | ResetInput () |
Resets all input for this ability. Can be overridden for ability specific directives More... | |
virtual void | EarlyProcessAbility () |
The first of the 3 passes you can have in your ability. Think of it as EarlyUpdate() if it existed More... | |
virtual void | LateProcessAbility () |
The last of the 3 passes you can have in your ability. Think of it as LateUpdate() More... | |
virtual void | PermitAbility (bool abilityPermitted) |
Changes the status of the ability's permission More... | |
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. More... | |
virtual void | SetInputManager (InputManager newInputManager) |
Changes the reference to the input manager with the one set in parameters More... | |
virtual void | PlayAbilityStartSfx () |
Plays the ability start sound effect More... | |
virtual void | PlayAbilityUsedSfx () |
Plays the ability used sound effect More... | |
virtual void | StopAbilityUsedSfx () |
Stops the ability used sound effect More... | |
virtual void | PlayAbilityStopSfx () |
Plays the ability stop sound effect More... | |
virtual void | PlayAbilityStartFeedbacks () |
Plays the ability start sound effect More... | |
virtual void | StopStartFeedbacks () |
Stops the ability used sound effect More... | |
virtual void | PlayAbilityStopFeedbacks () |
Plays the ability stop sound effect More... | |
Public Attributes | |
Weapon | InitialWeapon |
the initial weapon owned by the character More... | |
bool | CanPickupWeapons = true |
if this is set to true, the character can pick up PickableWeapons More... | |
MMFeedbacks | WeaponUseFeedback |
a feedback that gets triggered at the character level everytime the weapon is used More... | |
Transform | WeaponAttachment |
the position the weapon will be attached to. If left blank, will be this.transform. More... | |
Transform | ProjectileSpawn |
the position from which projectiles will be spawned (can be safely left empty) More... | |
bool | AutomaticallyBindAnimator = true |
if this is true this animator will be automatically bound to the weapon More... | |
int | AmmoDisplayID = 0 |
the ID of the AmmoDisplay this ability should update More... | |
bool | AutoIK = true |
if this is true, IK will be automatically setup if possible More... | |
bool | ContinuousPress = false |
if this is true you won't have to release your fire button to auto reload More... | |
bool | GettingHitInterruptsAttack = false |
whether or not this character getting hit should interrupt its attack (will only work if the weapon is marked as interruptable) More... | |
bool | UseSecondaryAxisThresholdToShoot = false |
whether or not pushing the secondary axis above its threshold should cause the weapon to shoot More... | |
bool | ForceWeaponAimControl = false |
if this is true, the ForcedWeaponAimControl mode will be applied to all weapons equipped by this character More... | |
WeaponAim.AimControls | ForcedWeaponAimControl = WeaponAim.AimControls.PrimaryMovement |
if ForceWeaponAimControl is true, the AimControls mode to apply to all weapons equipped by this character More... | |
bool | ForceAlwaysShoot = false |
if this is true, the character will continuously fire its weapon More... | |
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 More... | |
bool | NewInputExtendsBuffer |
if this is true, every new input will prolong the buffer More... | |
float | MaximumBufferDuration = 0.25f |
the maximum duration for the buffer, in seconds More... | |
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 More... | |
Weapon | CurrentWeapon |
the weapon currently equipped by the Character More... | |
OnWeaponChangeDelegate | OnWeaponChange |
a delegate you can hook to, to be notified of weapon changes More... | |
Public Attributes inherited from MoreMountains.TopDownEngine.CharacterAbility | |
AudioClip | AbilityStartSfx |
the sound fx to play when the ability starts More... | |
AudioClip | AbilityInProgressSfx |
the sound fx to play while the ability is running More... | |
AudioClip | AbilityStopSfx |
the sound fx to play when the ability stops More... | |
MMFeedbacks | AbilityStartFeedbacks |
the feedbacks to play when the ability starts More... | |
MMFeedbacks | AbilityStopFeedbacks |
the feedbacks to play when the ability stops More... | |
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 More... | |
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. More... | |
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. More... | |
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. More... | |
AbilityEvent | OnAbilityStart |
AbilityEvent | OnAbilityStop |
Protected Member Functions | |
override void | PreInitialization () |
Sets the weapon attachment More... | |
override void | Initialization () |
Gets and stores components for further use More... | |
virtual void | HandleCharacterState () |
Checks character state and stops shooting if not in normal state More... | |
virtual void | HandleFeedbacks () |
Triggers the weapon used feedback if needed More... | |
override void | HandleInput () |
Gets input and triggers methods based on what's been pressed More... | |
virtual void | HandleBuffer () |
Triggers an attack if the weapon is idle and an input has been buffered More... | |
virtual void | ExtendBuffer () |
Extends the duration of the buffer if needed More... | |
virtual void | InstantiateWeapon (Weapon newWeapon, string weaponID, bool combo=false) |
Instantiates the specified weapon More... | |
virtual void | HandleWeaponAim () |
Applies aim if possible More... | |
virtual void | HandleWeaponIK () |
Sets IK handles if needed More... | |
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 More... | |
override void | OnHit () |
Override this to describe what should happen to this ability when the character takes a hit More... | |
override void | OnDeath () |
Override this to describe what should happen to this ability when the character respawns More... | |
override void | OnRespawn () |
Override this to describe what should happen to this ability when the character respawns More... | |
Protected Member Functions inherited from MoreMountains.TopDownEngine.CharacterAbility | |
virtual void | Awake () |
On awake we proceed to pre initializing our ability More... | |
virtual void | Start () |
On Start(), we call the ability's intialization More... | |
virtual void | BindAnimator () |
Binds the animator from the character and initializes the animator parameters More... | |
virtual void | InternalHandleInput () |
Internal method to check if an input manager is present or not More... | |
virtual void | RegisterAnimatorParameter (string parameterName, AnimatorControllerParameterType parameterType, out int parameter) |
Registers a new animator parameter to the list More... | |
virtual void | OnEnable () |
On enable, we bind our respawn delegate More... | |
virtual void | OnDisable () |
On disable, we unbind our respawn delegate More... | |
Static Protected Attributes | |
const string | _weaponEquippedAnimationParameterName = "WeaponEquipped" |
const string | _weaponEquippedIDAnimationParameterName = "WeaponEquippedID" |
Properties | |
virtual int | HandleWeaponID [get] |
virtual Animator | CharacterAnimator [get, set] |
an animator to update when the weapon is used More... | |
virtual WeaponAim | WeaponAimComponent [get] |
the weapon's weapon aim component, if it has one More... | |
Properties inherited from MoreMountains.TopDownEngine.CharacterAbility | |
virtual bool | AbilityAuthorized [get] |
virtual bool | AbilityInitialized [get] |
whether or not this ability has been initialized More... | |
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
|
virtual |
Changes the character's current weapon to the one passed as a parameter
newWeapon | The new weapon. |
|
protectedvirtual |
Extends the duration of the buffer if needed
|
virtual |
Flips the current weapon if needed
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
|
virtual |
Forces the weapon to stop
|
protectedvirtual |
Triggers an attack if the weapon is idle and an input has been buffered
|
protectedvirtual |
Checks character state and stops shooting if not in normal state
|
protectedvirtual |
Triggers the weapon used feedback if needed
|
protectedvirtual |
Gets input and triggers methods based on what's been pressed
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
|
protectedvirtual |
Applies aim if possible
|
protectedvirtual |
Sets IK handles if needed
|
protectedvirtual |
|
virtual |
This method is only used to display a helpbox text at the beginning of the ability's inspector.
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
|
protectedvirtual |
Gets and stores components for further use
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
|
protectedvirtual |
Adds required animator parameters to the animator parameters list if they exist
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
|
protectedvirtual |
Instantiates the specified weapon
newWeapon | |
weaponID | |
combo |
|
protectedvirtual |
Override this to describe what should happen to this ability when the character respawns
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
|
protectedvirtual |
Override this to describe what should happen to this ability when the character takes a hit
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
|
protectedvirtual |
Override this to describe what should happen to this ability when the character respawns
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
delegate void MoreMountains.TopDownEngine.CharacterHandleWeapon.OnWeaponChangeDelegate | ( | ) |
|
protectedvirtual |
Sets the weapon attachment
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
|
virtual |
Every frame we check if it's needed to update the ammo display
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
|
virtual |
Reloads the weapon
|
virtual |
Grabs various components and inits stuff
|
virtual |
Causes the character to start shooting
|
virtual |
Causes the character to stop shooting
|
virtual |
Updates the ammo display bar and text.
|
virtual |
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().
Reimplemented from MoreMountains.TopDownEngine.CharacterAbility.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
int MoreMountains.TopDownEngine.CharacterHandleWeapon.AmmoDisplayID = 0 |
the ID of the AmmoDisplay this ability should update
bool MoreMountains.TopDownEngine.CharacterHandleWeapon.AutoIK = true |
if this is true, IK will be automatically setup if possible
bool MoreMountains.TopDownEngine.CharacterHandleWeapon.AutomaticallyBindAnimator = true |
if this is true this animator will be automatically bound to the weapon
bool MoreMountains.TopDownEngine.CharacterHandleWeapon.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 MoreMountains.TopDownEngine.CharacterHandleWeapon.CanPickupWeapons = true |
if this is set to true, the character can pick up PickableWeapons
bool MoreMountains.TopDownEngine.CharacterHandleWeapon.ContinuousPress = false |
if this is true you won't have to release your fire button to auto reload
Weapon MoreMountains.TopDownEngine.CharacterHandleWeapon.CurrentWeapon |
the weapon currently equipped by the Character
bool MoreMountains.TopDownEngine.CharacterHandleWeapon.ForceAlwaysShoot = false |
if this is true, the character will continuously fire its weapon
WeaponAim.AimControls MoreMountains.TopDownEngine.CharacterHandleWeapon.ForcedWeaponAimControl = WeaponAim.AimControls.PrimaryMovement |
if ForceWeaponAimControl is true, the AimControls mode to apply to all weapons equipped by this character
bool MoreMountains.TopDownEngine.CharacterHandleWeapon.ForceWeaponAimControl = false |
if this is true, the ForcedWeaponAimControl mode will be applied to all weapons equipped by this character
bool MoreMountains.TopDownEngine.CharacterHandleWeapon.GettingHitInterruptsAttack = false |
whether or not this character getting hit should interrupt its attack (will only work if the weapon is marked as interruptable)
Weapon MoreMountains.TopDownEngine.CharacterHandleWeapon.InitialWeapon |
the initial weapon owned by the character
float MoreMountains.TopDownEngine.CharacterHandleWeapon.MaximumBufferDuration = 0.25f |
the maximum duration for the buffer, in seconds
bool MoreMountains.TopDownEngine.CharacterHandleWeapon.NewInputExtendsBuffer |
if this is true, every new input will prolong the buffer
OnWeaponChangeDelegate MoreMountains.TopDownEngine.CharacterHandleWeapon.OnWeaponChange |
a delegate you can hook to, to be notified of weapon changes
Transform MoreMountains.TopDownEngine.CharacterHandleWeapon.ProjectileSpawn |
the position from which projectiles will be spawned (can be safely left empty)
bool MoreMountains.TopDownEngine.CharacterHandleWeapon.RequiresPerfectTile = false |
if this is true, and if this character is using GridMovement, then input will only be triggered when on a perfect tile
bool MoreMountains.TopDownEngine.CharacterHandleWeapon.UseSecondaryAxisThresholdToShoot = false |
whether or not pushing the secondary axis above its threshold should cause the weapon to shoot
Transform MoreMountains.TopDownEngine.CharacterHandleWeapon.WeaponAttachment |
the position the weapon will be attached to. If left blank, will be this.transform.
MMFeedbacks MoreMountains.TopDownEngine.CharacterHandleWeapon.WeaponUseFeedback |
a feedback that gets triggered at the character level everytime the weapon is used
|
getset |
an animator to update when the weapon is used
|
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
|
get |
the weapon's weapon aim component, if it has one