![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
This is the basic behaviour from which all enemy movement behaviours are derived. To create your own enemy movement extend this class. More...
Public Member Functions | |
virtual EnemyMovement | Init (Enemy enemy) |
Initialise this movement and return a reference to the ready to use movement. More... | |
virtual bool | DoMove () |
Does the movement. More... | |
virtual void | DoDamage (DamageInfo info) |
Do the damage movement More... | |
virtual void | DoDeath (DamageInfo info) |
Do the death movement More... | |
virtual void | GainingControl () |
Called when this movement is gaining control. More... | |
virtual bool | LosingControl () |
Called when this movement is losing control. More... | |
virtual void | SetDirection (Vector2 direction) |
Often a movement will need some kind of direction information such as where the cahracter is in relation to the enemy. Use this to set that information. Note there is no specific rule for what that information is, it could be anything. More... | |
virtual void | HitCharacter (Character character, DamageInfo info) |
Called when the enemy hits the character. More... | |
virtual void | SwitchDirection () |
Called by the enemy to switch (x) direction of the movement. Note that not all movements need to support this, they may do nothing. More... | |
virtual bool | CheckForEdge (int movementDirection) |
Uses the Enemies feet colliders to see if there is nothing below the enemy, and if so returns true. More... | |
![]() | |
virtual void | Validate (PlatformerProMonoBehaviour myTarget) |
Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive. More... | |
Protected Attributes | |
Enemy | enemy |
Cached reference to the character. More... | |
Properties | |
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 | FacingDirection [get] |
Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. More... | |
virtual bool | ShouldSnapToGround [get] |
If we are grounded shoudl we snap to the ground. Helps us handle slopes. More... | |
static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
![]() | |
virtual string | Header [get] |
Gets the header string used to describe the component. More... | |
virtual string | DocLink [get] |
Gets a link to documentation site. More... | |
virtual string | VideoLink [get] |
Gets a link to a youtube video. More... | |
virtual string | Deprecated [get] |
If non-null this component is deprecated. The string shows a message indicating how it should be replaced. More... | |
This is the basic behaviour from which all enemy movement behaviours are derived. To create your own enemy movement extend this class.
|
virtual |
Uses the Enemies feet colliders to see if there is nothing below the enemy, and if so returns true.
|
virtual |
Do the damage movement
Reimplemented in PlatformerPro.EnemyMovement_Distributor, PlatformerPro.EnemyMovement_Damaged_Knockback, PlatformerPro.EnemyMovement_Damaged_Bobble, PlatformerPro.EnemyMovement_Damaged_AnimationSyncPerDamageType, PlatformerPro.EnemyMovement_Damage_PlayAnimationOnly, and PlatformerPro.EnemyMovement_Damage_Freeze.
|
virtual |
Do the death movement
Reimplemented in PlatformerPro.EnemyMovement_Distributor, PlatformerPro.EnemyMovement_Damaged_Knockback, PlatformerPro.EnemyMovement_Damaged_Bobble, PlatformerPro.EnemyMovement_Damaged_AnimationSyncPerDamageType, PlatformerPro.EnemyMovement_Damage_PlayAnimationOnly, and PlatformerPro.EnemyMovement_Damage_Freeze.
|
virtual |
Does the movement.
true
, if this movement has been updated to match state, false
if the movement doesn't know how to handle this state or control can't be transitioned.Reimplemented in PlatformerPro.EnemyMovement_WaypointMover, PlatformerPro.EnemyMovement_VerticalSnapper, PlatformerPro.EnemyMovement_SimpleShoot, PlatformerPro.EnemyMovement_ShowDialog, PlatformerPro.EnemyMovement_ShootWithDeployAndAim, PlatformerPro.EnemyMovement_PlayAnimationOnly, PlatformerPro.EnemyMovement_PatrolWithShoot, PlatformerPro.EnemyMovement_Patrol, PlatformerPro.EnemyMovement_MoveToPosition, PlatformerPro.EnemyMovement_MeleeAttack, PlatformerPro.EnemyMovement_HideWithDeploy, PlatformerPro.EnemyMovement_FreeFollowTarget, PlatformerPro.EnemyMovement_FlyUpAndDown, PlatformerPro.EnemyMovement_Distributor, PlatformerPro.EnemyMovement_Damaged_Knockback, PlatformerPro.EnemyMovement_Damaged_Bobble, PlatformerPro.EnemyMovement_Damaged_AnimationSyncPerDamageType, PlatformerPro.EnemyMovement_Damage_PlayAnimationOnly, PlatformerPro.EnemyMovement_Damage_Freeze, PlatformerPro.EnemyMovement_ChargeWithBounce, PlatformerPro.EnemyMovement_ChargeAtTarget, and PlatformerPro.EnemyMovement_Charge.
|
virtual |
Called when this movement is gaining control.
Reimplemented in PlatformerPro.EnemyMovement_WaypointMover, and PlatformerPro.EnemyMovement_MoveToPosition.
|
virtual |
Called when the enemy hits the character.
character | Character. |
info | Damage info. |
Reimplemented in PlatformerPro.EnemyMovement_VerticalSnapper, PlatformerPro.EnemyMovement_Patrol, PlatformerPro.EnemyMovement_FreeFollowTarget, PlatformerPro.EnemyMovement_Distributor, PlatformerPro.EnemyMovement_Damaged_Bobble, PlatformerPro.EnemyMovement_ChargeAtTarget, and PlatformerPro.EnemyMovement_Charge.
|
virtual |
Initialise this movement and return a reference to the ready to use movement.
Reimplemented in PlatformerPro.EnemyMovement_WaypointMover, PlatformerPro.EnemyMovement_VerticalSnapper, PlatformerPro.EnemyMovement_SimpleShoot, PlatformerPro.EnemyMovement_ShootWithDeployAndAim, PlatformerPro.EnemyMovement_PlayAnimationOnly, PlatformerPro.EnemyMovement_PatrolWithShoot, PlatformerPro.EnemyMovement_Patrol, PlatformerPro.EnemyMovement_MeleeAttack, PlatformerPro.EnemyMovement_HideWithDeploy, PlatformerPro.EnemyMovement_FreeFollowTarget, PlatformerPro.EnemyMovement_FlyUpAndDown, PlatformerPro.EnemyMovement_Distributor, PlatformerPro.EnemyMovement_Damaged_Knockback, PlatformerPro.EnemyMovement_Damaged_Bobble, PlatformerPro.EnemyMovement_Damaged_AnimationSyncPerDamageType, PlatformerPro.EnemyMovement_Damage_PlayAnimationOnly, PlatformerPro.EnemyMovement_Damage_Freeze, PlatformerPro.EnemyMovement_ChargeAtTarget, and PlatformerPro.EnemyMovement_Charge.
|
virtual |
Called when this movement is losing control.
true
, if a final animation is being played and control should not revert false
otherwise.Reimplemented in PlatformerPro.EnemyMovement_WaypointMover, PlatformerPro.EnemyMovement_SimpleShoot, PlatformerPro.EnemyMovement_ShowDialog, PlatformerPro.EnemyMovement_ShootWithDeployAndAim, PlatformerPro.EnemyMovement_PlayAnimationOnly, PlatformerPro.EnemyMovement_MoveToPosition, PlatformerPro.EnemyMovement_MeleeAttack, and PlatformerPro.EnemyMovement_HideWithDeploy.
|
virtual |
Often a movement will need some kind of direction information such as where the cahracter is in relation to the enemy. Use this to set that information. Note there is no specific rule for what that information is, it could be anything.
direction | Direction. |
Reimplemented in PlatformerPro.EnemyMovement_Patrol, PlatformerPro.EnemyMovement_FreeFollowTarget, PlatformerPro.EnemyMovement_ChargeAtTarget, and PlatformerPro.EnemyMovement_Charge.
|
virtual |
Called by the enemy to switch (x) direction of the movement. Note that not all movements need to support this, they may do nothing.
Reimplemented in PlatformerPro.EnemyMovement_VerticalSnapper, PlatformerPro.EnemyMovement_Patrol, PlatformerPro.EnemyMovement_FreeFollowTarget, PlatformerPro.EnemyMovement_Distributor, PlatformerPro.EnemyMovement_ChargeAtTarget, and PlatformerPro.EnemyMovement_Charge.
|
protected |
Cached reference to the character.
|
get |
Gets the animation state that this movement wants to set.
|
get |
Returns the direction the character is facing. 0 for none, 1 for right, -1 for left.
|
staticget |
Static movement info used by the editor.
|
get |
Gets the animation override state that this movement wants to set.
|
get |
If we are grounded shoudl we snap to the ground. Helps us handle slopes.
true
if should snap to ground; otherwise, false
.