FCV Engine 0.1
A tool and framework for tutorials in game development
Loading...
Searching...
No Matches
RangedWeapon Class Reference

Component to build custom ranged weapon with all damage functionality in this class sent from Projectile class. More...

Inheritance diagram for RangedWeapon:
Weapon

Public Member Functions

virtual void Equip ()
 Equips weapon and subcribes to fireAction.
 
virtual void UnEquip ()
 Unequips and un-subscribes to fireAction.
 

Protected Member Functions

override void Fire ()
 Spawns projectile on firepoint transform and subscribes to hitAction on projectile to control damage.
 
override void Update ()
 Controls the visual and aim function for the ranged weapon.
 
virtual void DealDamage (Health health, Vector2 direction)
 If weapon hits: this function removes health from the Health component provided.
 
virtual bool CanFire ()
 function for if the cooldown has elapsed
 

Detailed Description

Component to build custom ranged weapon with all damage functionality in this class sent from Projectile class.

Definition at line 6 of file RangedWeapon.cs.

Member Function Documentation

◆ CanFire()

virtual bool CanFire ( )
protectedvirtualinherited

function for if the cooldown has elapsed

Returns
true if cooldown has elapsed

Definition at line 83 of file Weapon.cs.

◆ DealDamage()

virtual void DealDamage ( Health health,
Vector2 direction )
protectedvirtualinherited

If weapon hits: this function removes health from the Health component provided.

Parameters
healthHealth component to deal damage to
directiondirection hit came from, put to (0,0) if no knockback is desired

Definition at line 67 of file Weapon.cs.


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