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

Static Public Member Functions

static void InitForAsyncUsage (bool warmUpDeviceIdentifier)
 

Detailed Description

User-friendly wrapper around few internally used Unity APIs which can't be accessed from background threads.

You only need to touch this if you are going to use ObscuredFile / ObscuredFilePrefs from the background threads.

Member Function Documentation

◆ InitForAsyncUsage()

static void InitForAsyncUsage ( bool  warmUpDeviceIdentifier)
inlinestatic

Call this from the main thread before using ObscuredFile / ObscuredFilePrefs from the background threads.

Calling this method avoids getting exceptions while working with ObscuredFile / ObscuredFilePrefs from the background threads.

Parameters
warmUpDeviceIdentifierPass true to init API needed for the Lock To Device feature (SystemInfo.deviceUniqueIdentifier). You need this to be true only when using ObscuredFile / ObscuredFilePrefs from the background threads with DeviceLock enabled and without custom DeviceID set. Passing true is similar to the DeviceIdHolder.ForceLockToDeviceInit() call, please read that API docs for more information about possible side effects.