Anti-Cheat Toolkit  2023.2.6
Multi-purpose anti-cheat solution for Unity Engine
KeepAliveBehaviour< T > Class Template Reference

Inherits MonoBehaviour.

Inherited by ACTkDetectorBase< T >.

Public Attributes

bool keepAlive = true
 

Properties

static T Instance [get, protected set]
 

Detailed Description

Base class for ACTk in-scene objects which able to survive scene switch.

WARNING: Will behave incorrectly if created within any non-default [RuntimeInitializeOnLoadMethod] except RuntimeInitializeLoadType.AfterSceneLoad (which is default).

Type Constraints
T :KeepAliveBehaviour<T> 

Member Data Documentation

◆ keepAlive

bool keepAlive = true

Will survive new level (scene) load if checked. Otherwise it will be destroyed.

On dispose Behaviour follows 2 rules:

  • if Game Object's name is "Anti-Cheat Toolkit": it will be automatically destroyed if no other Behaviours left attached regardless of any other components or children;
  • if Game Object's name is NOT "Anti-Cheat Toolkit": it will be automatically destroyed only if it has neither other components nor children attached;

Property Documentation

◆ Instance

T Instance
staticgetprotected set

Allows reaching public properties from code. Can be null if behaviour does not exist in scene or if accessed at or before Awake phase.