Projectile used in projectile (ranged) attacks. Note you don't have to use projectile class for projectiles.
More...
|
virtual void | Fire (int damageAmount, DamageType damageType, Vector2 direction, IMob character, float charge=1.0f) |
| Call to start the projectile moving. More...
|
|
virtual void | Finish () |
| End the characters attack, for most projectiles you will ignore this, but it may be useful for some movement types. More...
|
|
virtual void | DestroyProjectile (bool isEnemyHit) |
| Destroy projectile. More...
|
|
override 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...
|
|
|
override string | Header [get] |
|
float | Charge [get, protected set] |
| Gets the charge which can be used by effects, etc. More...
|
|
int | ChargeLevel [get, protected set] |
| Gets the charge as an int which can be used by effects, etc. 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...
|
|
Projectile used in projectile (ranged) attacks. Note you don't have to use projectile class for projectiles.
◆ CalculateDamageAmount()
virtual int PlatformerPro.Projectile.CalculateDamageAmount |
( |
int |
damageAmount, |
|
|
float |
charge |
|
) |
| |
|
protectedvirtual |
Calculates the actual damage amount.
- Returns
- The damage amount.
- Parameters
-
damageAmount | Damage amount from the attack. |
charge | Charge time. |
Reimplemented in PlatformerPro.ChargableProjectile.
◆ CalculateSpeed()
virtual float PlatformerPro.Projectile.CalculateSpeed |
( |
float |
charge | ) |
|
|
protectedvirtual |
◆ DestroyProjectile()
virtual void PlatformerPro.Projectile.DestroyProjectile |
( |
bool |
isEnemyHit | ) |
|
|
virtual |
◆ DoDestroy()
virtual IEnumerator PlatformerPro.Projectile.DoDestroy |
( |
bool |
isEnemyHit | ) |
|
|
protectedvirtual |
Sends the destory event, then waits for detroy delay, then destroys GO.
◆ Finish()
virtual void PlatformerPro.Projectile.Finish |
( |
| ) |
|
|
virtual |
End the characters attack, for most projectiles you will ignore this, but it may be useful for some movement types.
◆ Fire()
virtual void PlatformerPro.Projectile.Fire |
( |
int |
damageAmount, |
|
|
DamageType |
damageType, |
|
|
Vector2 |
direction, |
|
|
IMob |
character, |
|
|
float |
charge = 1.0f |
|
) |
| |
|
virtual |
◆ Move()
virtual void PlatformerPro.Projectile.Move |
( |
| ) |
|
|
protectedvirtual |
Move the projectile, override if you want custom movement.
◆ OnProjectileDestroyed()
virtual void PlatformerPro.Projectile.OnProjectileDestroyed |
( |
DamageInfo |
info | ) |
|
|
protectedvirtual |
Raises the projectile destroyed event.
- Parameters
-
◆ OnProjectileFired()
virtual void PlatformerPro.Projectile.OnProjectileFired |
( |
| ) |
|
|
protectedvirtual |
Raises the projectile fired event.
- Parameters
-
◆ Validate()
Override this method if you want to provide custom validation. The actual code should be surrounded by the if UNITY_EDITOR / endif directive.
Reimplemented from PlatformerPro.PlatformerProMonoBehaviour.
◆ actualSpeed
float PlatformerPro.Projectile.actualSpeed |
|
protected |
◆ autoExplodeDelay
float PlatformerPro.Projectile.autoExplodeDelay |
How long after projectile fires should we wait before automatically exploding it. 0 Means it wont explodes until it hits something.
isho
◆ damageInfo
Damage this projectile will cause.
◆ destroyDelay
float PlatformerPro.Projectile.destroyDelay |
How long after projectile collides should we wait before destroying it.
◆ destroyOnEnemyHit
bool PlatformerPro.Projectile.destroyOnEnemyHit |
Should this object be destroyed when this object hits an enemy?
◆ destroyOnSceneryHit
bool PlatformerPro.Projectile.destroyOnSceneryHit |
Should this object be destroyed when this object hits scenery?
◆ direction
Vector2 PlatformerPro.Projectile.direction |
◆ fired
bool PlatformerPro.Projectile.fired |
|
protected |
◆ myRigidbody
Rigidbody2D PlatformerPro.Projectile.myRigidbody |
|
protected |
Cached rigidbody. IF a non-kinematic rigidboy is attached we launch by setting velocity and do not move each frame.
◆ projectileHitBox
The hit box that causes damage to enemies.
◆ remainingLifetime
float PlatformerPro.Projectile.remainingLifetime |
|
protected |
How long before we destory this bullet.
◆ rotate
bool PlatformerPro.Projectile.rotate = true |
Should the projectile be rotated to face the direction of travel.
◆ speed
float PlatformerPro.Projectile.speed |
How fast the projectile moves.
◆ visibleComponents
GameObject PlatformerPro.Projectile.visibleComponents |
If non-null then this GameObject will ne turned on when the projectile is fired. Used for syncing projectile visuals with animation events.
◆ Charge
float PlatformerPro.Projectile.Charge |
|
getprotected set |
Gets the charge which can be used by effects, etc.
The charge.
◆ ChargeLevel
int PlatformerPro.Projectile.ChargeLevel |
|
getprotected set |
Gets the charge as an int which can be used by effects, etc.
The charge.
◆ Header
override string PlatformerPro.Projectile.Header |
|
get |
◆ ProjectileDestroyed
Event for when a projectile crashes in to something. If the object being crashed in to is not an enemy then the damage info will be null.
◆ ProjectileFired
System.EventHandler<EmptyEventArgs> PlatformerPro.Projectile.ProjectileFired |
Event for when a projectile is fired. Typically used for enabling effects.
The documentation for this class was generated from the following file:
- D:/Projects/platformer-pro-2019.3/Assets/PlatformerPro/Scripts/Attacks/Projectiles/Projectile.cs