Corgi Engine  v8.8
MoreMountains.CorgiEngine.StunZone Class Reference

A stun zone will stun any character with a CharacterStun ability entering it More...

Inheritance diagram for MoreMountains.CorgiEngine.StunZone:
MoreMountains.CorgiEngine.CorgiMonoBehaviour

Public Types

enum  StunModes { StunModes.Forever, StunModes.ForDuration }
 the possible stun modes : Forever : stuns until StunExit is called on the CharacterStun component, ForDuration : stuns for a duration, and then the character will exit stun on its own More...
 

Public Member Functions

virtual void OnTriggerStay2D (Collider2D collider)
 When a collision with the player is triggered, we give damage to the player and knock it back More...
 
virtual void OnTriggerEnter2D (Collider2D collider)
 On trigger enter 2D, we call our colliding endpoint More...
 

Public Attributes

LayerMask TargetLayerMask
 
StunModes StunMode = StunModes.ForDuration
 the chosen stun mode (Forever : stuns until StunExit is called on the CharacterStun component, ForDuration : stuns for a duration, and then the character will exit stun on its own) More...
 
float StunDuration = 2f
 if in ForDuration mode, the duration of the stun in seconds More...
 
bool DisableZoneOnStun = true
 whether or not to disable the zone after the stun has happened More...
 
bool AutoDisable = true
 if this is true, the zone will be disabled after the duration has passed More...
 
float AutoDisableDuration = 0.3f
 the duration (in seconds) before the zone auto disables itself More...
 

Protected Member Functions

void OnEnable ()
 On enable, we start our disable countdown if necessary More...
 
virtual IEnumerator AutoDisableCo ()
 A coroutine used to disable the zone after a certain duration More...
 
virtual void Colliding (GameObject collider)
 When colliding with a gameobject, we make sure it's a target, and if yes, we stun it More...
 

Protected Attributes

Character _character
 
CharacterStun _characterStun
 

Detailed Description

A stun zone will stun any character with a CharacterStun ability entering it

Member Enumeration Documentation

◆ StunModes

the possible stun modes : Forever : stuns until StunExit is called on the CharacterStun component, ForDuration : stuns for a duration, and then the character will exit stun on its own

Enumerator
Forever 
ForDuration 

Member Function Documentation

◆ AutoDisableCo()

virtual IEnumerator MoreMountains.CorgiEngine.StunZone.AutoDisableCo ( )
protectedvirtual

A coroutine used to disable the zone after a certain duration

Returns

◆ Colliding()

virtual void MoreMountains.CorgiEngine.StunZone.Colliding ( GameObject  collider)
protectedvirtual

When colliding with a gameobject, we make sure it's a target, and if yes, we stun it

Parameters
collider

◆ OnEnable()

void MoreMountains.CorgiEngine.StunZone.OnEnable ( )
protected

On enable, we start our disable countdown if necessary

◆ OnTriggerEnter2D()

virtual void MoreMountains.CorgiEngine.StunZone.OnTriggerEnter2D ( Collider2D  collider)
virtual

On trigger enter 2D, we call our colliding endpoint

Parameters
collider

S

◆ OnTriggerStay2D()

virtual void MoreMountains.CorgiEngine.StunZone.OnTriggerStay2D ( Collider2D  collider)
virtual

When a collision with the player is triggered, we give damage to the player and knock it back

Parameters
colliderwhat's colliding with the object.

Member Data Documentation

◆ _character

Character MoreMountains.CorgiEngine.StunZone._character
protected

◆ _characterStun

CharacterStun MoreMountains.CorgiEngine.StunZone._characterStun
protected

◆ AutoDisable

bool MoreMountains.CorgiEngine.StunZone.AutoDisable = true

if this is true, the zone will be disabled after the duration has passed

◆ AutoDisableDuration

float MoreMountains.CorgiEngine.StunZone.AutoDisableDuration = 0.3f

the duration (in seconds) before the zone auto disables itself

◆ DisableZoneOnStun

bool MoreMountains.CorgiEngine.StunZone.DisableZoneOnStun = true

whether or not to disable the zone after the stun has happened

◆ StunDuration

float MoreMountains.CorgiEngine.StunZone.StunDuration = 2f

if in ForDuration mode, the duration of the stun in seconds

◆ StunMode

StunModes MoreMountains.CorgiEngine.StunZone.StunMode = StunModes.ForDuration

the chosen stun mode (Forever : stuns until StunExit is called on the CharacterStun component, ForDuration : stuns for a duration, and then the character will exit stun on its own)

◆ TargetLayerMask

LayerMask MoreMountains.CorgiEngine.StunZone.TargetLayerMask

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