Corgi Engine  v8.8
MoreMountains.CorgiEngine.KillsManager Class Reference
Inheritance diagram for MoreMountains.CorgiEngine.KillsManager:
MoreMountains.Tools.MMSingleton< KillsManager > MoreMountains.Tools.MMEventListener< MMLifeCycleEvent >

Public Types

enum  Modes { Modes.Layer, Modes.List }
 

Public Member Functions

virtual void RefreshRemainingDeaths ()
 Use this method to change the current death threshold. This will also update the remaining death counter More...
 
virtual void ComputeKillThresholdBasedOnTargetLayerMask ()
 Computes the required death threshold based by counting objects on the selected layer mask More...
 
virtual void OnMMEvent (MMLifeCycleEvent lifeCycleEvent)
 When we get a death even More...
 
- Public Member Functions inherited from MoreMountains.Tools.MMEventListener< MMLifeCycleEvent >
void OnMMEvent (T eventType)
 

Public Attributes

Modes Mode = Modes.Layer
 
List< HealthTargetsList
 a list of Health components on the targets. Once all these targets are dead, OnLastDeath will trigger More...
 
LayerMask TargetLayerMask = LayerManager.EnemiesLayerMask
 the layer(s) on which the dying Health components should be to be counted - typically Enemies More...
 
bool AutoSetKillThreshold = true
 in Layer mode, if AutoSetKillThreshold is true, the KillThreshold will be automatically computed on start, based on the total number of potential targets in the level matching the target layer mask More...
 
int DeathThreshold = 5
 The maximum amount of kills needed to trigger OnLastDeath. More...
 
int RemainingDeaths = 0
 The amount of deaths remaining to trigger OnLastDeath. Read only value. More...
 
UnityEvent OnDeath
 An event that gets triggered on every death. More...
 
UnityEvent OnLastDeath
 An event that gets triggered when the last death occurs. More...
 
Text TotalCounter
 An optional text counter displaying the total amount of deaths required before OnLastDeath triggers. More...
 
Text RemainingCounter
 An optional text counter displaying the remaining amount of deaths before OnLastDeath. More...
 

Protected Member Functions

virtual void Start ()
 On start we initialize our remaining deaths counter More...
 
virtual void UpdateTexts ()
 Updates the bound texts if necessary More...
 
virtual void OnEnable ()
 OnDisable, we start listening to events. More...
 
virtual void OnDisable ()
 OnDisable, we stop listening to events. More...
 
- Protected Member Functions inherited from MoreMountains.Tools.MMSingleton< KillsManager >
virtual void Awake ()
 On awake, we initialize our instance. Make sure to call base.Awake() in override if you need awake. More...
 
virtual void InitializeSingleton ()
 Initializes the singleton. More...
 

Static Protected Member Functions

static void InitializeStatics ()
 Statics initialization to support enter play modes More...
 

Additional Inherited Members

- Static Public Member Functions inherited from MoreMountains.Tools.MMSingleton< KillsManager >
static T TryGetInstance ()
 
- Static Public Attributes inherited from MoreMountains.Tools.MMSingleton< KillsManager >
static bool HasInstance
 
static T Current
 
- Static Protected Attributes inherited from MoreMountains.Tools.MMSingleton< KillsManager >
static T _instance
 
- Properties inherited from MoreMountains.Tools.MMSingleton< KillsManager >
static T Instance [get]
 Singleton design pattern More...
 

Member Enumeration Documentation

◆ Modes

Enumerator
Layer 
List 

Member Function Documentation

◆ ComputeKillThresholdBasedOnTargetLayerMask()

virtual void MoreMountains.CorgiEngine.KillsManager.ComputeKillThresholdBasedOnTargetLayerMask ( )
virtual

Computes the required death threshold based by counting objects on the selected layer mask

◆ InitializeStatics()

static void MoreMountains.CorgiEngine.KillsManager.InitializeStatics ( )
staticprotected

Statics initialization to support enter play modes

◆ OnDisable()

virtual void MoreMountains.CorgiEngine.KillsManager.OnDisable ( )
protectedvirtual

OnDisable, we stop listening to events.

◆ OnEnable()

virtual void MoreMountains.CorgiEngine.KillsManager.OnEnable ( )
protectedvirtual

OnDisable, we start listening to events.

◆ OnMMEvent()

virtual void MoreMountains.CorgiEngine.KillsManager.OnMMEvent ( MMLifeCycleEvent  lifeCycleEvent)
virtual

When we get a death even

Parameters
lifeCycleEvent

◆ RefreshRemainingDeaths()

virtual void MoreMountains.CorgiEngine.KillsManager.RefreshRemainingDeaths ( )
virtual

Use this method to change the current death threshold. This will also update the remaining death counter

Parameters
newThreshold

◆ Start()

virtual void MoreMountains.CorgiEngine.KillsManager.Start ( )
protectedvirtual

On start we initialize our remaining deaths counter

◆ UpdateTexts()

virtual void MoreMountains.CorgiEngine.KillsManager.UpdateTexts ( )
protectedvirtual

Updates the bound texts if necessary

Member Data Documentation

◆ AutoSetKillThreshold

bool MoreMountains.CorgiEngine.KillsManager.AutoSetKillThreshold = true

in Layer mode, if AutoSetKillThreshold is true, the KillThreshold will be automatically computed on start, based on the total number of potential targets in the level matching the target layer mask

◆ DeathThreshold

int MoreMountains.CorgiEngine.KillsManager.DeathThreshold = 5

The maximum amount of kills needed to trigger OnLastDeath.

◆ Mode

Modes MoreMountains.CorgiEngine.KillsManager.Mode = Modes.Layer

◆ OnDeath

UnityEvent MoreMountains.CorgiEngine.KillsManager.OnDeath

An event that gets triggered on every death.

◆ OnLastDeath

UnityEvent MoreMountains.CorgiEngine.KillsManager.OnLastDeath

An event that gets triggered when the last death occurs.

◆ RemainingCounter

Text MoreMountains.CorgiEngine.KillsManager.RemainingCounter

An optional text counter displaying the remaining amount of deaths before OnLastDeath.

◆ RemainingDeaths

int MoreMountains.CorgiEngine.KillsManager.RemainingDeaths = 0

The amount of deaths remaining to trigger OnLastDeath. Read only value.

◆ TargetLayerMask

LayerMask MoreMountains.CorgiEngine.KillsManager.TargetLayerMask = LayerManager.EnemiesLayerMask

the layer(s) on which the dying Health components should be to be counted - typically Enemies

◆ TargetsList

List<Health> MoreMountains.CorgiEngine.KillsManager.TargetsList

a list of Health components on the targets. Once all these targets are dead, OnLastDeath will trigger

◆ TotalCounter

Text MoreMountains.CorgiEngine.KillsManager.TotalCounter

An optional text counter displaying the total amount of deaths required before OnLastDeath triggers.


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