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

Component to build custom melee weapons with different swing options. More...

Inheritance diagram for MeleeWeapon:
Weapon

Public Member Functions

override void Equip ()
 Equips melee weapon and sets default positions and rotations.
 
override void UnEquip ()
 Does un-equip functionality of Weapon base class and enables the spriteRenderer.
 

Protected Member Functions

override void Fire ()
 Starts the swing animation and set start time for it.
 
virtual IEnumerator Swing ()
 Controls the swing animation by lerping rotations and positions on a local scale.
 
virtual void Update ()
 Updates cooldown and controls input for invoking fireAction.
 
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 melee weapons with different swing options.

Definition at line 9 of file MeleeWeapon.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.

◆ Swing()

virtual IEnumerator Swing ( )
protectedvirtual

Controls the swing animation by lerping rotations and positions on a local scale.

Returns

Definition at line 71 of file MeleeWeapon.cs.


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