Anti-Cheat Toolkit  2023.2.6
Multi-purpose anti-cheat solution for Unity Engine
SpeedHackProofTime Class Reference

Inherits KeepAliveBehaviour< SpeedHackProofTime >.

Static Public Member Functions

static void Init ()
 
static void Dispose ()
 

Public Attributes

bool keepAlive
 

Properties

static float? time [get]
 
static float? unscaledTime [get]
 
static float? deltaTime [get]
 
static float? unscaledDeltaTime [get]
 
static float? realtimeSinceStartup [get]
 
static float? timeSinceLevelLoad [get]
 
static T Instance [get, protected set]
 

Detailed Description

Speed-hack resistant Time.* alternative. Does proxies to the regular Time.* APIs until actual speed hack is detected.

Requires running SpeedHackDetector to operate properly. Make sure to start SpeedHackDetector before calling Init().
Uses Unity's Time.* APIs until speed hack is detected and switches to the speed-hack resistant time since then. May be unreliable in WebGL and other sandboxed environments.

Member Function Documentation

◆ Init()

static void Init ( )
inlinestatic

Call to add to the scene and force internal initialization. Gets called automatically when necessary if not initialized.

Make sure to call it after you setup and run SpeedHackDetector.

◆ Dispose()

static void Dispose ( )
inlinestatic

Call to remove from scene and clean internal resources.

Member Data Documentation

◆ keepAlive

bool keepAlive
inherited

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

◆ time

float? time
staticget

Speed-hack resistant analogue on Unity's Time.time API.

◆ unscaledTime

float? unscaledTime
staticget

Speed-hack resistant analogue on Unity's Time.unscaledTime API.

◆ deltaTime

float? deltaTime
staticget

Speed-hack resistant analogue on Unity's Time.deltaTime API.

◆ unscaledDeltaTime

float? unscaledDeltaTime
staticget

Speed-hack resistant analogue on Unity's Time.unscaledDeltaTime API.

◆ realtimeSinceStartup

float? realtimeSinceStartup
staticget

Speed-hack resistant analogue on Unity's Time.realtimeSinceStartup API.

◆ timeSinceLevelLoad

float? timeSinceLevelLoad
staticget

Speed-hack resistant analogue on Unity's Time.timeSinceLevelLoad API.

◆ Instance

T Instance
staticgetprotected setinherited

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