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

A component that uses OverlapCircle method in Physics2D to deal damage against objects with Health component and in assigned LayerMask. More...

Inheritance diagram for Damager:

Public Member Functions

void SetAttackCooldown (float time)
 Sets the current cooldown to provided one if time is greater than current cooldown.
 

Private Member Functions

void LateUpdate ()
 Checks for last position and in which direction the damager object is moving.
 
void FixedUpdate ()
 Controls cooldown functionality and does the OverlapCircle check and then sends the Collider2D to CollisionChecks()
 
void DealDamage (Health health)
 Deals damage to Health component.
 
void CollisionChecks (Collider2D other)
 Checks if all requirments are met when collider is hit with overlap check and deals damage if success.
 

Detailed Description

A component that uses OverlapCircle method in Physics2D to deal damage against objects with Health component and in assigned LayerMask.

Definition at line 9 of file Damager.cs.

Member Function Documentation

◆ CollisionChecks()

void CollisionChecks ( Collider2D other)
private

Checks if all requirments are met when collider is hit with overlap check and deals damage if success.

Parameters
othercollider2D to check against

Definition at line 98 of file Damager.cs.

◆ DealDamage()

void DealDamage ( Health health)
private

Deals damage to Health component.

Parameters
healthHealth component to deal damage against

Definition at line 70 of file Damager.cs.

◆ SetAttackCooldown()

void SetAttackCooldown ( float time)

Sets the current cooldown to provided one if time is greater than current cooldown.

Parameters
timecooldown time

Definition at line 87 of file Damager.cs.


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