Eye of the Nile Docs
Everything you need to know to get started!
Loading...
Searching...
No Matches
TornadoProjectile Class Reference

Detailed Description

Script for a tornado projectile that deals no damage, instead pushing targets away with its hitbox. Inherits from BasicProjectile.

Documentation updated 9/7/2024

Author
Stephen Nuttall

Public Attributes

float despawnTime = 5f
 Seconds until the projectile despawns.
 

Protected Member Functions

override void StartMethods ()
 Start the despawn timer, as well as the base functionality of playing the spawning sound effect.
 
- Protected Member Functions inherited from BaseProjectile
virtual void AwakeMethods ()
 Runs when Awake() is called.
 
virtual void OnTriggerEnterMethods (Collider2D collision)
 Runs if the projectile collides with an object (and it's a trigger zone). Does nothing by default.
 
virtual void OnCollisionEnterMethods (Collision2D collisionInfo)
 Runs if the projectile collides with an object. Damages the object it collided with if possible, then destroys the projectile.

Parameters
collisionInfoRepresents the object the projectile collided with.

 
void UpdateFacing ()
 Flips the sprite and movement direction (if a compatable component for projectile movement is attached) depending on if the projectile is currently facing left or right.
 

Private Member Functions

IEnumerator DespawnTimer ()
 Functionality of the DespawnTimer script, but was written before it was created.
 
void OnCollisionEnter2D (Collision2D collisionInfo)
 Do nothing. Ignore base functionality.
 

Additional Inherited Members

- Public Member Functions inherited from BaseProjectile
void FlipDirection ()
 
- Protected Attributes inherited from BaseProjectile
GameObject sprite
 Reference to the game object that holds the sprite renderer of the projectile. Often this is just the projectile itself, but sometimes there's a child with the sprite. This allows compatability with both systems.
 
int damage = 30
 The amount of damage the projectile will apply if it comes in contact with something it can damage.
 
bool damagePlayers = true
 If true, the projectile can damage the player.
 
bool damageNonPlayers = true
 If true, the projectile can damage objects that aren't the player (assuming they have an ObjectHealth component).
 
bool destroyOnImpact = true
 If true, the projectile will destroy itself when it hits something (regardless of if it can damage it or now).
 
EventReference spawnSFX
 Sound effect that plays when the projectile is spawned in.
 
bool flipSprite = true
 When facingLeft is true, the sprite will be flipped. Usually used to make the sprite "face the way the projectile is moving.".
 
- Properties inherited from BaseProjectile
int refDamage [get, private set]
 A mirror of damage that allows for other objects to read its value without changing it, and also allowing damage to appear in the Unity Editor.
 
bool facingLeft = false [get, private set]
 True if the projectile is facing (and thus moving) to the left. Likewise, false if the projectile is facing to the right.
 

Member Function Documentation

◆ DespawnTimer()

IEnumerator TornadoProjectile.DespawnTimer ( )
private

Functionality of the DespawnTimer script, but was written before it was created.

Wait for despawn time to be up,

then destory the projectile.

◆ OnCollisionEnter2D()

void TornadoProjectile.OnCollisionEnter2D ( Collision2D collisionInfo)
private

Do nothing. Ignore base functionality.

Don't do anything on impact.

◆ StartMethods()

override void TornadoProjectile.StartMethods ( )
protectedvirtual

Start the despawn timer, as well as the base functionality of playing the spawning sound effect.

Reimplemented from BaseProjectile.

Member Data Documentation

◆ despawnTime

float TornadoProjectile.despawnTime = 5f

Seconds until the projectile despawns.


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