![]() |
Platformer Pro
2.3.2
A platform game kit for Unity.
|
An enemy movement that simply runs in a given direction optionaly shotting projectiles. More...
Public Member Functions | |
override EnemyMovement | Init (Enemy enemy) |
Initialise this movement and return a reference to the ready to use movement. More... | |
override bool | DoMove () |
Moves the character. More... | |
override void | HitCharacter (Character character, DamageInfo info) |
Called when the enemy hits the character. More... | |
override 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 void | FirePreparedProjectile () |
Fired a previously prepared projectile. More... | |
override void | SetDirection (Vector2 direction) |
Set the direction of the charge. 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 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... | |
Public Attributes | |
float | speed |
The speed the platform moves at. More... | |
bool | bounceOnHit |
Will the enemy change direction when it hits the character? More... | |
bool | walkOffEdges = true |
Will the enemy change direction when it finds an edge? More... | |
float | rateOfFire = 2.0f |
How often to shoot More... | |
float | shootTime = 0.25f |
How often to shoot More... | |
GameObject | projectilePrefab |
The prefab to use for the projectile. More... | |
int | damageAmount |
The damage amount. More... | |
DamageType | damageType |
The type of the damage. More... | |
bool | delayFire |
If true don't actually fire a project, just prepare it. Used so an animation event can trigger projectile firing. More... | |
AnimationState | animationState = AnimationState.WALK |
The animation state to set while charging. More... | |
Protected Member Functions | |
virtual void | DoShoot () |
Do the shoot. More... | |
virtual IEnumerator | ShootRoutine () |
virtual void | DoPrepare (Projectile projectile) |
Prepares a projectile ready for firing. More... | |
Protected Attributes | |
float | firingTimer |
When this is zero ... shoot! More... | |
ProjectileAimer | projectileAimer |
Cached reference to a projectile aimer, or null if there is no aimer. 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... | |
Vector2 | preparedOffset |
Cached offset ready to be used when projectile fired by animation event. More... | |
![]() | |
Enemy | enemy |
Cached reference to the character. More... | |
Static Protected Attributes | |
const string | overrideName = "SHOOT" |
Name of the animation override More... | |
Properties | |
new static MovementInfo | Info [get] |
Static movement info used by the editor. More... | |
override AnimationState | AnimationState [get] |
Gets the animation state that this movement wants to set. More... | |
override int | FacingDirection [get] |
Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. 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 | 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... | |
An enemy movement that simply runs in a given direction optionaly shotting projectiles.
|
virtual |
Moves the character.
Reimplemented from PlatformerPro.EnemyMovement.
Reimplemented in PlatformerPro.EnemyMovement_ChargeWithBounce, and PlatformerPro.EnemyMovement_ChargeAtTarget.
|
protectedvirtual |
Prepares a projectile ready for firing.
projectile | Projectile. |
|
protectedvirtual |
Do the shoot.
|
virtual |
Fired a previously prepared projectile.
|
virtual |
Called when the enemy hits the character.
character | Character. |
info | Damage info. |
Reimplemented from PlatformerPro.EnemyMovement.
Reimplemented in PlatformerPro.EnemyMovement_ChargeAtTarget.
|
virtual |
Initialise this movement and return a reference to the ready to use movement.
Reimplemented from PlatformerPro.EnemyMovement.
Reimplemented in PlatformerPro.EnemyMovement_ChargeAtTarget.
|
virtual |
Set the direction of the charge.
direction | Direction. |
Reimplemented from PlatformerPro.EnemyMovement.
Reimplemented in PlatformerPro.EnemyMovement_ChargeAtTarget.
|
protectedvirtual |
Fire projectile then temporarily set an animation override.
|
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 from PlatformerPro.EnemyMovement.
Reimplemented in PlatformerPro.EnemyMovement_ChargeAtTarget.
AnimationState PlatformerPro.EnemyMovement_Charge.animationState = AnimationState.WALK |
The animation state to set while charging.
bool PlatformerPro.EnemyMovement_Charge.bounceOnHit |
Will the enemy change direction when it hits the character?
int PlatformerPro.EnemyMovement_Charge.damageAmount |
The damage amount.
DamageType PlatformerPro.EnemyMovement_Charge.damageType |
The type of the damage.
bool PlatformerPro.EnemyMovement_Charge.delayFire |
If true don't actually fire a project, just prepare it. Used so an animation event can trigger projectile firing.
|
protected |
When this is zero ... shoot!
|
staticprotected |
Name of the animation override
|
protected |
Cached direction ready to be used when projectile fired by animation event.
|
protected |
Cached offset 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.
GameObject PlatformerPro.EnemyMovement_Charge.projectilePrefab |
The prefab to use for the projectile.
float PlatformerPro.EnemyMovement_Charge.rateOfFire = 2.0f |
How often to shoot
float PlatformerPro.EnemyMovement_Charge.shootTime = 0.25f |
How often to shoot
float PlatformerPro.EnemyMovement_Charge.speed |
The speed the platform moves at.
bool PlatformerPro.EnemyMovement_Charge.walkOffEdges = true |
Will the enemy change direction when it finds an edge?
|
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.