Feel  5.1
The best way to improve your game's feel and make it extra juicy
MoreMountains.Tools.MMTimedActivation Class Reference

Add this component to an object and it'll be auto destroyed X seconds after its Start() More...

Inheritance diagram for MoreMountains.Tools.MMTimedActivation:

Public Types

enum  TimedStatusChange { TimedStatusChange.Enable, TimedStatusChange.Disable, TimedStatusChange.Destroy }
 the possible activation modes More...
 
enum  ActivationModes {
  ActivationModes.Awake, ActivationModes.Start, ActivationModes.OnEnable, ActivationModes.OnTriggerEnter,
  ActivationModes.OnTriggerExit, ActivationModes.OnTriggerEnter2D, ActivationModes.OnTriggerExit2D, ActivationModes.Script
}
 the possible trigger modes More...
 
enum  TriggerModes { TriggerModes.None, TriggerModes.Tag, TriggerModes.Layer }
 the possible ways to check if the collider matches More...
 
enum  DelayModes { DelayModes.Time, DelayModes.Frames }
 the possible delay modes More...
 

Public Member Functions

virtual void TriggerSequence ()
 Call this method to start the countdown to activation More...
 

Public Attributes

ActivationModes ActivationMode = ActivationModes.Start
 the moment you want the countdown to state change to start More...
 
TriggerModes TriggerMode
 the target layer for activation if using OnTriggerEnter or OnTriggerExit More...
 
LayerMask TargetTriggerLayer
 the layer the target collider should be on More...
 
string TargetTriggerTag
 the tag the target collider should have More...
 
DelayModes DelayMode = DelayModes.Time
 the chosen delay mode, whether to wait in seconds or frames More...
 
float TimeBeforeStateChange = 2
 The time (in seconds) before we destroy the object. More...
 
int FrameCount = 1
 the amount of frames to wait for when in Frames DelayMode More...
 
List< GameObject > TargetGameObjects
 the possible targets you want the state to change More...
 
List< MonoBehaviour > TargetBehaviours
 the possible targets you want the state to change More...
 
TimedStatusChange TimeDestructionMode = TimedStatusChange.Disable
 the destruction mode for this object : destroy or disable More...
 
UnityEvent TimedActions
 Unity events to trigger after the delay. More...
 

Protected Member Functions

virtual void Awake ()
 On awake, initialize our delay and trigger our change state countdown if needed More...
 
virtual void Start ()
 On start, trigger our change state countdown if needed More...
 
virtual void OnEnable ()
 On enable, trigger our change state countdown if needed More...
 
virtual void OnTriggerEnter (Collider collider)
 On trigger enter, we start our countdown if needed More...
 
virtual void OnTriggerExit (Collider collider)
 On trigger exit, we start our countdown if needed More...
 
virtual void OnTriggerEnter2D (Collider2D collider)
 On trigger enter 2D, we start our countdown if needed More...
 
virtual void OnTriggerExit2D (Collider2D collider)
 On trigger exit 2D, we start our countdown if needed More...
 
virtual bool CorrectTagOrLayer (GameObject target)
 Returns true if the target matches our settings, false otherwise More...
 
virtual void StartChangeState ()
 On start change state, starts the timed activation More...
 
virtual IEnumerator TimedActivationSequence ()
 Waits and triggers state change and events More...
 
virtual void Activate ()
 Triggers actions if needed More...
 
virtual void StateChange ()
 Changes the object's status or destroys it More...
 

Detailed Description

Add this component to an object and it'll be auto destroyed X seconds after its Start()

Member Enumeration Documentation

◆ ActivationModes

the possible trigger modes

Enumerator
Awake 
Start 
OnEnable 
OnTriggerEnter 
OnTriggerExit 
OnTriggerEnter2D 
OnTriggerExit2D 
Script 

◆ DelayModes

the possible delay modes

Enumerator
Time 
Frames 

◆ TimedStatusChange

the possible activation modes

Enumerator
Enable 
Disable 
Destroy 

◆ TriggerModes

the possible ways to check if the collider matches

Enumerator
None 
Tag 
Layer 

Member Function Documentation

◆ Activate()

virtual void MoreMountains.Tools.MMTimedActivation.Activate ( )
protectedvirtual

Triggers actions if needed

◆ Awake()

virtual void MoreMountains.Tools.MMTimedActivation.Awake ( )
protectedvirtual

On awake, initialize our delay and trigger our change state countdown if needed

◆ CorrectTagOrLayer()

virtual bool MoreMountains.Tools.MMTimedActivation.CorrectTagOrLayer ( GameObject  target)
protectedvirtual

Returns true if the target matches our settings, false otherwise

Parameters
target
Returns

◆ OnEnable()

virtual void MoreMountains.Tools.MMTimedActivation.OnEnable ( )
protectedvirtual

On enable, trigger our change state countdown if needed

◆ OnTriggerEnter()

virtual void MoreMountains.Tools.MMTimedActivation.OnTriggerEnter ( Collider  collider)
protectedvirtual

On trigger enter, we start our countdown if needed

Parameters
collider

◆ OnTriggerEnter2D()

virtual void MoreMountains.Tools.MMTimedActivation.OnTriggerEnter2D ( Collider2D  collider)
protectedvirtual

On trigger enter 2D, we start our countdown if needed

Parameters
collider

◆ OnTriggerExit()

virtual void MoreMountains.Tools.MMTimedActivation.OnTriggerExit ( Collider  collider)
protectedvirtual

On trigger exit, we start our countdown if needed

Parameters
collider

◆ OnTriggerExit2D()

virtual void MoreMountains.Tools.MMTimedActivation.OnTriggerExit2D ( Collider2D  collider)
protectedvirtual

On trigger exit 2D, we start our countdown if needed

Parameters
collider

◆ Start()

virtual void MoreMountains.Tools.MMTimedActivation.Start ( )
protectedvirtual

On start, trigger our change state countdown if needed

◆ StartChangeState()

virtual void MoreMountains.Tools.MMTimedActivation.StartChangeState ( )
protectedvirtual

On start change state, starts the timed activation

◆ StateChange()

virtual void MoreMountains.Tools.MMTimedActivation.StateChange ( )
protectedvirtual

Changes the object's status or destroys it

◆ TimedActivationSequence()

virtual IEnumerator MoreMountains.Tools.MMTimedActivation.TimedActivationSequence ( )
protectedvirtual

Waits and triggers state change and events

◆ TriggerSequence()

virtual void MoreMountains.Tools.MMTimedActivation.TriggerSequence ( )
virtual

Call this method to start the countdown to activation

Member Data Documentation

◆ ActivationMode

ActivationModes MoreMountains.Tools.MMTimedActivation.ActivationMode = ActivationModes.Start

the moment you want the countdown to state change to start

◆ DelayMode

DelayModes MoreMountains.Tools.MMTimedActivation.DelayMode = DelayModes.Time

the chosen delay mode, whether to wait in seconds or frames

◆ FrameCount

int MoreMountains.Tools.MMTimedActivation.FrameCount = 1

the amount of frames to wait for when in Frames DelayMode

◆ TargetBehaviours

List<MonoBehaviour> MoreMountains.Tools.MMTimedActivation.TargetBehaviours

the possible targets you want the state to change

◆ TargetGameObjects

List<GameObject> MoreMountains.Tools.MMTimedActivation.TargetGameObjects

the possible targets you want the state to change

◆ TargetTriggerLayer

LayerMask MoreMountains.Tools.MMTimedActivation.TargetTriggerLayer

the layer the target collider should be on

◆ TargetTriggerTag

string MoreMountains.Tools.MMTimedActivation.TargetTriggerTag

the tag the target collider should have

◆ TimeBeforeStateChange

float MoreMountains.Tools.MMTimedActivation.TimeBeforeStateChange = 2

The time (in seconds) before we destroy the object.

◆ TimedActions

UnityEvent MoreMountains.Tools.MMTimedActivation.TimedActions

Unity events to trigger after the delay.

◆ TimeDestructionMode

TimedStatusChange MoreMountains.Tools.MMTimedActivation.TimeDestructionMode = TimedStatusChange.Disable

the destruction mode for this object : destroy or disable

◆ TriggerMode

TriggerModes MoreMountains.Tools.MMTimedActivation.TriggerMode

the target layer for activation if using OnTriggerEnter or OnTriggerExit


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