![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
Handles the setup of basic single button attacks for air and ground. This is a "special" movement. It derives from movement but has a lot of additional functionality. More...
Public Member Functions | |
override Movement | Init (Character character) |
Initialise this movement and retyrn a reference to the ready to use movement. More... | |
virtual float | GetRawChargeForAttack (int index) |
Gets the charge level for a given attack (by index). Returns -1 if not charging. Does not process through the digital charge filters if present. More... | |
virtual float | GetChargeForAttack (int index) |
Gets the charge level for a given attack (by index). Returns -1 if not charging. More... | |
virtual int | GetIndexForName (string name) |
Gets the index of the givne atack in the attack data or -1 if no match found. More... | |
virtual bool | WantsAttack () |
Gets a value indicating whether this movement wants to initiate an attack. More... | |
virtual bool | WantsToSetAnimationState () |
Gets a value indicating whether this movement wants to set the animation state. More... | |
virtual bool | Attack () |
Do whichever attack is available. More... | |
virtual void | InterruptAttack () |
Forces an attack to stop More... | |
virtual void | HitEnemy (IMob enemy, DamageInfo info) |
Called when the character hits an enemy. More... | |
virtual float | GetAttackCoolDown (int attackIndex) |
Gets the cool down time for an attack. More... | |
virtual float | GetAttackCoolDownRemaining (int attackIndex) |
Gets the remaining cool down time for an attack. More... | |
virtual void | EnableHitBox () |
Enable the current attacks hit box immediately. Usually used when using animation events to enable hitboxes. More... | |
virtual void | DisableHitBox () |
Disable the current attacks hit box immediately. Usually used when using animation events to enable hitboxes. More... | |
virtual void | InstantiateProjectile () |
Instantiates the deferred projectile. More... | |
virtual void | InstantiateProjectile (int attackIndex) |
Instatiates a projectile. More... | |
virtual void | FirePreparedProjectile () |
Fired a previously prepared projectile. More... | |
virtual int | GetAttackDamage (BasicAttackData data) |
Gets the attack damage including modifiers More... | |
virtual float | GetAttackTime (BasicAttackData data) |
Gets the attack time including modifiers More... | |
virtual float | GetAttackTime (float baseTime) |
override bool | ForceMaintainControl () |
If the attack is in progress force control. More... | |
virtual bool | BlockJump () |
Should we block jumping movement? More... | |
virtual bool | BlockWall () |
Should we block wall movement? More... | |
virtual bool | BlockClimb () |
Should we block climb movement? More... | |
virtual bool | BlockSpecial () |
Should we block climb movement? More... | |
![]() | |
virtual Movement | Init (Character character, MovementVariable[] movementData) |
Initialise the movement with the given movement data. More... | |
virtual string | PostInitValidation () |
Called after initialisation to check if this movement is configured correctly. Typically used to stop wrapper movements being the default and ending up in infinite loops. More... | |
virtual void | DoMove () |
Moves the character. More... | |
virtual void | PostCollisionDoMove () |
Does any movement that MUST be done after collissions are calculated. More... | |
virtual bool | CheckAdditionalConditions () |
If this is true then the movement wants to maintain control of the character even if default transition conditions suggest it shouldn't. More... | |
virtual void | ConditionsActivated () |
Call activated on each condition. More... | |
virtual void | GainControl () |
Called when the movement gets control. Typically used to do initialisation of velocity and the like. More... | |
virtual void | LosingControl () |
Called when the movement loses control. Override to do any reset type actions. More... | |
virtual bool | IsGrounded () |
Determines whether this character is grounded. Only applied if ShouldDoBaseCollisions returned false this frame. Else the IsGrounded() method from the base collisions will be used. More... | |
Public Attributes | |
List< BasicAttackData > | attacks |
The attack data. More... | |
bool | attackSystemWantsMovementControl |
Does the attack also override movement. If false then the attack system will not control movement and animations handling will depend on attackSystemWantsAnimationStateOverride. More... | |
bool | attackSystemWantsAnimationStateOverride |
Does the attack override animation. If false then the attack system will only set an animation override not an animation state. More... | |
![]() | |
bool | skipEquipmentMultipliers |
If true don't apply equipment multipliers to this movement. More... | |
bool | skipUpgradeMultipliers |
If true don't apply upgrade multipliers to this movement. More... | |
bool | skipPowerUpMultipliers |
If true don't apply power-up multipliers to this movement. More... | |
Protected Member Functions | |
virtual void | PostInit () |
Init this instance. More... | |
virtual bool | CheckLocation (BasicAttackData attackData) |
Is the character in the right place for the given attack. More... | |
virtual bool | CheckInput (BasicAttackData attackData) |
Is the input correct for the given attack. This implmenetation is simple a key press, but another could be more complex (queueable combo attacks, or complex key combinations). More... | |
virtual bool | CheckAmmo (BasicAttackData attackData) |
Checks that the player has enough ammo to fire. More... | |
virtual bool | CheckConditions () |
Checks any additional conditions. More... | |
virtual void | ConsumeAmmo (BasicAttackData attackData) |
Consumes ammo. More... | |
virtual void | StartAttack (int attackIndex) |
Starts the given attack. More... | |
virtual IEnumerator | DoAttack (int attackIndex) |
Do a melee attack. More... | |
virtual IEnumerator | DoAnimationSyncedAttack (int attackIndex) |
Do a melee attack with length controlled by the animation. More... | |
virtual void | DoAttackStart (int attackIndex) |
Start an attack. More... | |
virtual void | DoAttackEnd (int attackIndex) |
Finish an attack. More... | |
virtual IEnumerator | DoProjectileAttack (int attackIndex) |
Do a projectile attack. More... | |
virtual void | DoPrepare (Projectile projectile, int index) |
Prepares a projectile ready for firing. More... | |
![]() | |
void | AssignReferences (Character character) |
Initialise this movement and return a reference to the ready to use movement. More... | |
Protected Attributes | |
int | currentAttack |
Index of the current attack or -1 if no current attack. More... | |
float | currentAttackTimer |
The timer for the current attack. More... | |
ProjectileAimer | projectileAimer |
Cached reference to a projectile aimer, or null if there is no aimer. More... | |
int | deferredAttackIndex |
The index of the deferred attack. More... | |
ItemManager | itemManager |
Cached reference to the item manager used for ammo. More... | |
float[] | cooldownTimers |
The cooldown timers. More... | |
float[] | chargeTimers |
The charge timers. More... | |
Projectile | preparedProjectile |
Cached projectile ready to be fired by animation event. More... | |
Vector2 | preparedDirection |
Cached direction ready to be used when projectile fired by animation event. More... | |
int | preparedAttackData |
Cached attack data index ready to be used when projectile fired by animation event. More... | |
bool | attackAnimationStarted |
Tracks if the state named for the current attacks animation has started playing in the animator. More... | |
![]() | |
Character | character |
Cached reference to the character. More... | |
AdditionalCondition[] | conditions |
Cached list of all additional conditions. More... | |
Properties | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
virtual bool | IsAttacking [get] |
Gets a value indicating whether this instance is attacking. More... | |
virtual string | ActiveAttackName [get] |
Gets the name of the active attack or null if no attack is aactive. More... | |
virtual float | ActiveAttackNormalisedTime [get] |
Gets the normalised time of the active attack or -1 if no attack is aactive. More... | |
Animator | AttackAnimator [get, set] |
Animator used for calculating attack time. More... | |
int | AttackAnimatorLayer [get, set] |
Layer to use for attack animations. More... | |
virtual AttackLocation | ActiveAttackLocation [get] |
Gets the active attack location or ANY if no activeattack. More... | |
virtual bool | ActiveAttackHasHit [get] |
Returns true if the current attacks hit box has hit an enemy. More... | |
virtual bool | CanHaveMultipleAttacks [get] |
Used by the inspector to determine if a given attack can have multiple attacks defined in it. More... | |
virtual bool | CanUserSetAttackType [get] |
Used by the inspector to determine if a given attack can have multiple attacks defined in it. More... | |
virtual float | Charge [get] |
Gets the cahrge amount. More... | |
override AnimationState | AnimationState [get] |
Gets the animation state that this movement wants to set. More... | |
override int | AnimationPriority [get] |
Gets the priority of the animation state that this movement wants to set. More... | |
override string | OverrideState [get] |
Gets the animation override state that this movement wants to set. More... | |
override bool | ShouldApplyGravity [get] |
Gets a value indicating whether this PlatformerPro.Movement expects gravity to be applied after its movement finishes. More... | |
![]() | |
virtual Character | Character [get] |
Sets the character for this movement. More... | |
virtual bool | Enabled [get, set] |
A custom enable which base movements can use to pass on enable values. More... | |
virtual Movement | Implementation [get] |
Gets the underlying implementation (if not overridden return itself). More... | |
virtual bool | ShouldApplyGravity [get] |
Gets a value indicating whether this PlatformerPro.Movement expects gravity to be applied after its movement finishes. More... | |
virtual float | CurrentGravity [get] |
Gets a value indicating the current gravity, only used if this movement doesn't apply the default gravity.
| |
virtual RaycastType | ShouldDoBaseCollisions [get] |
Gets a value indicating whether this PlatformerPro.Movement expects the base collisions to be executed after its movement finishes. More... | |
virtual bool | ShouldDoRotations [get] |
Gets a value indicating whether this PlatformerPro.Movement expects the rotations to be calculated and applied by the character. More... | |
virtual AnimationState | AnimationState [get] |
Gets the animation state that this movement wants to set. More... | |
virtual string | OverrideState [get] |
Gets the animation override state that this movement wants to set. More... | |
virtual int | AnimationPriority [get] |
Gets the priority of the animation state that this movement wants to set. More... | |
virtual int | FacingDirection [get] |
Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. More... | |
virtual bool | PreventXVelocityReset [get] |
If true then don't allow base collisions to reset velocity in X. More... | |
static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
virtual VelocityType | VelocityType [get] |
How does this movement use Velocity. More... | |
Additional Inherited Members | |
![]() | |
static bool | CheckSideCollisions (Character character, int requiredHits, RaycastType types) |
Utility method which checks for side collissions. More... | |
Handles the setup of basic single button attacks for air and ground. This is a "special" movement. It derives from movement but has a lot of additional functionality.
|
virtual |
Do whichever attack is available.
Reimplemented in PlatformerPro.PowerBombAttack, PlatformerPro.DashAttack, and PlatformerPro.ComboAttacks.
|
virtual |
Should we block climb movement?
true
, if climb should be blocked, false
otherwise.
|
virtual |
Should we block jumping movement?
true
, if jump should be blocked, false
otherwise.
|
virtual |
Should we block climb movement?
true
, if jump should be blocked, false
otherwise.
|
virtual |
Should we block wall movement?
true
, if wall cling should be blocked, false
otherwise.
|
protectedvirtual |
Checks that the player has enough ammo to fire.
true
, if ammo was checked, false
otherwise.attackData | Attack data. |
|
protectedvirtual |
Checks any additional conditions.
true
, if conditions was met, false
otherwise.
|
protectedvirtual |
Is the input correct for the given attack. This implmenetation is simple a key press, but another could be more complex (queueable combo attacks, or complex key combinations).
true
, if input was checked, false
otherwise.attackData | Attack data. |
Reimplemented in PlatformerPro.PowerBombAttack, and PlatformerPro.BasicAttacksWithAutoFire.
|
protectedvirtual |
Is the character in the right place for the given attack.
true
, if location was checked, false
otherwise.attackData | Attack data. |
Reimplemented in PlatformerPro.PowerBombAttack.
|
protectedvirtual |
Consumes ammo.
true
, if ammo was checked, false
otherwise.attackData | Attack data. |
|
virtual |
Disable the current attacks hit box immediately. Usually used when using animation events to enable hitboxes.
|
protectedvirtual |
Do a melee attack with length controlled by the animation.
attackIndex | Attack index. |
|
protectedvirtual |
Do a melee attack.
attackIndex | Attack index. |
Reimplemented in PlatformerPro.PowerBombAttack.
|
protectedvirtual |
Finish an attack.
attackIndex |
|
protectedvirtual |
Start an attack.
attackIndex |
|
protectedvirtual |
Prepares a projectile ready for firing.
projectile | Projectile. |
projectile | Index of attack data. |
|
protectedvirtual |
Do a projectile attack.
attackIndex | Attack index. |
Reimplemented in PlatformerPro.MultiProjectileAttacks.
|
virtual |
Enable the current attacks hit box immediately. Usually used when using animation events to enable hitboxes.
|
virtual |
Fired a previously prepared projectile.
|
virtual |
If the attack is in progress force control.
Reimplemented from PlatformerPro.Movement.
|
virtual |
Gets the cool down time for an attack.
attackIndex | Attack index. |
|
virtual |
Gets the remaining cool down time for an attack.
attackIndex | Attack index. |
|
virtual |
Gets the attack damage including modifiers
data | Base AttackData |
|
virtual |
Gets the attack time including modifiers
data | Base AttackData |
|
virtual |
|
virtual |
Gets the charge level for a given attack (by index). Returns -1 if not charging.
index | Index. |
|
virtual |
Gets the index of the givne atack in the attack data or -1 if no match found.
name | Name. |
|
virtual |
Gets the charge level for a given attack (by index). Returns -1 if not charging. Does not process through the digital charge filters if present.
index | Index. |
|
virtual |
Called when the character hits an enemy.
enemy | Enemy that was hit. |
info | Damage info. |
Initialise this movement and retyrn a reference to the ready to use movement.
Reimplemented from PlatformerPro.Movement.
|
virtual |
Instantiates the deferred projectile.
|
virtual |
Instatiates a projectile.
attackIndex | Index of the projectile to instantiate. |
Reimplemented in PlatformerPro.MultiProjectileAttacks.
|
virtual |
Forces an attack to stop
|
protectedvirtual |
Init this instance.
Reimplemented in PlatformerPro.PowerBombAttack, PlatformerPro.MultiProjectileAttacks, and PlatformerPro.ComboAttacks.
|
protectedvirtual |
Starts the given attack.
attackIndex | Attack index. |
Reimplemented in PlatformerPro.PowerBombAttack, and PlatformerPro.MultiProjectileAttacks.
|
virtual |
Gets a value indicating whether this movement wants to initiate an attack.
true
if this instance should attack; otherwise, false
.
Reimplemented in PlatformerPro.ComboAttacks.
|
virtual |
Gets a value indicating whether this movement wants to set the animation state.
true
, if wants to set animation state, false
otherwise.
|
protected |
Tracks if the state named for the current attacks animation has started playing in the animator.
List<BasicAttackData> PlatformerPro.BasicAttacks.attacks |
The attack data.
bool PlatformerPro.BasicAttacks.attackSystemWantsAnimationStateOverride |
Does the attack override animation. If false then the attack system will only set an animation override not an animation state.
bool PlatformerPro.BasicAttacks.attackSystemWantsMovementControl |
Does the attack also override movement. If false then the attack system will not control movement and animations handling will depend on attackSystemWantsAnimationStateOverride.
|
protected |
The charge timers.
|
protected |
The cooldown timers.
|
protected |
Index of the current attack or -1 if no current attack.
|
protected |
The timer for the current attack.
|
protected |
The index of the deferred attack.
|
protected |
Cached reference to the item manager used for ammo.
|
protected |
Cached attack data index ready to be used when projectile fired by animation event.
|
protected |
Cached direction ready to be used when projectile fired by animation event.
|
protected |
Cached projectile ready to be fired by animation event.
|
protected |
Cached reference to a projectile aimer, or null if there is no aimer.
|
get |
Returns true if the current attacks hit box has hit an enemy.
|
get |
Gets the active attack location or ANY if no activeattack.
|
get |
Gets the name of the active attack or null if no attack is aactive.
true
if active attack name; otherwise, false
.
|
get |
Gets the normalised time of the active attack or -1 if no attack is aactive.
true
if active attack name; otherwise, false
.
|
get |
Gets the priority of the animation state that this movement wants to set.
|
get |
Gets the animation state that this movement wants to set.
The state of the animation.
|
getset |
Animator used for calculating attack time.
|
getset |
Layer to use for attack animations.
|
get |
Used by the inspector to determine if a given attack can have multiple attacks defined in it.
|
get |
Used by the inspector to determine if a given attack can have multiple attacks defined in it.
|
get |
Gets the cahrge amount.
The charge.
|
staticget |
Static movement info used by the editor.
|
get |
Gets a value indicating whether this instance is attacking.
true
if this instance is attacking; otherwise, false
.
|
get |
Gets the animation override state that this movement wants to set.
|
get |
Gets a value indicating whether this PlatformerPro.Movement expects gravity to be applied after its movement finishes.