Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.EnemyMovement_SimpleShoot Class Reference

Enemy movement which spawns a projectile and sets an animation override. More...

Inheritance diagram for PlatformerPro.EnemyMovement_SimpleShoot:
PlatformerPro.EnemyMovement PlatformerPro.PlatformerProMonoBehaviour PlatformerPro.EnemyMovement_PatrolWithShoot PlatformerPro.EnemyMovement_ShootWithDeployAndAim

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...
 
virtual void FirePreparedProjectile ()
 Fired a previously prepared projectile. More...
 
override bool LosingControl ()
 Called when this movement is losing control. More...
 
- Public Member Functions inherited from PlatformerPro.EnemyMovement
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 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...
 
- Public Member Functions inherited from PlatformerPro.PlatformerProMonoBehaviour
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

GameObject projectilePrefab
 The prefab to use for the projectile. More...
 
bool delayFire
 If true don't actually fire a project, just prepare it. Used so an animation event can trigger projectile firing. More...
 
float rateOfFire = 1.0f
 How often to shoot More...
 
float shootTime = 0.25f
 How often to shoot More...
 
int damageAmount
 The damage amount. More...
 
DamageType damageType
 The type of the damage. More...
 
string overrideName = "SHOOT"
 Name of the animation override More...
 
bool setAnimationState
 Should we set an animation state and override (true) or just an override (false). More...
 
AnimationState shootAnimationState = AnimationState.ATTACK_SHOOT
 Animation to use when shooting. More...
 
AnimationState idleAnimationState = AnimationState.IDLE
 Animation to use when not shooting. More...
 

Protected Member Functions

virtual void DoShoot ()
 Do the shoot. More...
 
virtual IEnumerator ShootRoutine ()
 Fire projectile then temporarily set an animation override. More...
 
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...
 
bool isShooting
 Are we currently shooting. More...
 
Projectile preparedProjectile
 Cached projectile ready to be fired by animation event. More...
 
Vector2 preparedDirection
 Cached projectile ready to be used when projectile fired by animation event. More...
 
- Protected Attributes inherited from PlatformerPro.EnemyMovement
Enemy enemy
 Cached reference to the character. 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...
 
- Properties inherited from PlatformerPro.EnemyMovement
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...
 
- Properties inherited from PlatformerPro.PlatformerProMonoBehaviour
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...
 

Detailed Description

Enemy movement which spawns a projectile and sets an animation override.

Member Function Documentation

◆ DoMove()

override bool PlatformerPro.EnemyMovement_SimpleShoot.DoMove ( )
virtual

Moves the character.

Reimplemented from PlatformerPro.EnemyMovement.

◆ DoPrepare()

virtual void PlatformerPro.EnemyMovement_SimpleShoot.DoPrepare ( Projectile  projectile)
protectedvirtual

Prepares a projectile ready for firing.

Parameters
projectileProjectile.

◆ DoShoot()

virtual void PlatformerPro.EnemyMovement_SimpleShoot.DoShoot ( )
protectedvirtual

Do the shoot.

◆ FirePreparedProjectile()

virtual void PlatformerPro.EnemyMovement_SimpleShoot.FirePreparedProjectile ( )
virtual

Fired a previously prepared projectile.

◆ Init()

override EnemyMovement PlatformerPro.EnemyMovement_SimpleShoot.Init ( Enemy  enemy)
virtual

Initialise this movement and return a reference to the ready to use movement.

Reimplemented from PlatformerPro.EnemyMovement.

◆ LosingControl()

override bool PlatformerPro.EnemyMovement_SimpleShoot.LosingControl ( )
virtual

Called when this movement is losing control.

Returns
true, if a final animation is being played and control should not revert false otherwise.

Reimplemented from PlatformerPro.EnemyMovement.

◆ ShootRoutine()

virtual IEnumerator PlatformerPro.EnemyMovement_SimpleShoot.ShootRoutine ( )
protectedvirtual

Fire projectile then temporarily set an animation override.

Reimplemented in PlatformerPro.EnemyMovement_ShootWithDeployAndAim.

Member Data Documentation

◆ damageAmount

int PlatformerPro.EnemyMovement_SimpleShoot.damageAmount

The damage amount.

◆ damageType

DamageType PlatformerPro.EnemyMovement_SimpleShoot.damageType

The type of the damage.

◆ delayFire

bool PlatformerPro.EnemyMovement_SimpleShoot.delayFire

If true don't actually fire a project, just prepare it. Used so an animation event can trigger projectile firing.

◆ firingTimer

float PlatformerPro.EnemyMovement_SimpleShoot.firingTimer
protected

When this is zero ... shoot!

◆ idleAnimationState

AnimationState PlatformerPro.EnemyMovement_SimpleShoot.idleAnimationState = AnimationState.IDLE

Animation to use when not shooting.

◆ isShooting

bool PlatformerPro.EnemyMovement_SimpleShoot.isShooting
protected

Are we currently shooting.

◆ overrideName

string PlatformerPro.EnemyMovement_SimpleShoot.overrideName = "SHOOT"

Name of the animation override

◆ preparedDirection

Vector2 PlatformerPro.EnemyMovement_SimpleShoot.preparedDirection
protected

Cached projectile ready to be used when projectile fired by animation event.

◆ preparedProjectile

Projectile PlatformerPro.EnemyMovement_SimpleShoot.preparedProjectile
protected

Cached projectile ready to be fired by animation event.

◆ projectileAimer

ProjectileAimer PlatformerPro.EnemyMovement_SimpleShoot.projectileAimer
protected

Cached reference to a projectile aimer, or null if there is no aimer.

◆ projectilePrefab

GameObject PlatformerPro.EnemyMovement_SimpleShoot.projectilePrefab

The prefab to use for the projectile.

◆ rateOfFire

float PlatformerPro.EnemyMovement_SimpleShoot.rateOfFire = 1.0f

How often to shoot

◆ setAnimationState

bool PlatformerPro.EnemyMovement_SimpleShoot.setAnimationState

Should we set an animation state and override (true) or just an override (false).

◆ shootAnimationState

AnimationState PlatformerPro.EnemyMovement_SimpleShoot.shootAnimationState = AnimationState.ATTACK_SHOOT

Animation to use when shooting.

◆ shootTime

float PlatformerPro.EnemyMovement_SimpleShoot.shootTime = 0.25f

How often to shoot

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.EnemyMovement_SimpleShoot.AnimationState
get

Gets the animation state that this movement wants to set.

◆ Info

new static MovementInfo PlatformerPro.EnemyMovement_SimpleShoot.Info
staticget

Static movement info used by the editor.


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