TopDown Engine  v4.2
MoreMountains.TopDownEngine.KillsManager Class Reference
Inheritance diagram for MoreMountains.TopDownEngine.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.TopDownEngine.KillsManager.ComputeKillThresholdBasedOnTargetLayerMask ( )
virtual

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

◆ InitializeStatics()

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

Statics initialization to support enter play modes

◆ OnDisable()

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

OnDisable, we stop listening to events.

◆ OnEnable()

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

OnDisable, we start listening to events.

◆ OnMMEvent()

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

When we get a death even

Parameters
lifeCycleEvent

◆ RefreshRemainingDeaths()

virtual void MoreMountains.TopDownEngine.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.TopDownEngine.KillsManager.Start ( )
protectedvirtual

On start we initialize our remaining deaths counter

◆ UpdateTexts()

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

Updates the bound texts if necessary

Member Data Documentation

◆ AutoSetKillThreshold

bool MoreMountains.TopDownEngine.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.TopDownEngine.KillsManager.DeathThreshold = 5

The maximum amount of kills needed to trigger OnLastDeath.

◆ Mode

Modes MoreMountains.TopDownEngine.KillsManager.Mode = Modes.Layer

◆ OnDeath

UnityEvent MoreMountains.TopDownEngine.KillsManager.OnDeath

An event that gets triggered on every death.

◆ OnLastDeath

UnityEvent MoreMountains.TopDownEngine.KillsManager.OnLastDeath

An event that gets triggered when the last death occurs.

◆ RemainingCounter

Text MoreMountains.TopDownEngine.KillsManager.RemainingCounter

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

◆ RemainingDeaths

int MoreMountains.TopDownEngine.KillsManager.RemainingDeaths = 0

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

◆ TargetLayerMask

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

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

◆ TargetsList

List<Health> MoreMountains.TopDownEngine.KillsManager.TargetsList

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

◆ TotalCounter

Text MoreMountains.TopDownEngine.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: