Class UnityApiResultsHolder
User-friendly wrapper around few internally used Unity APIs which can't be accessed from background threads.
public static class UnityApiResultsHolder
- Inheritance
-
objectUnityApiResultsHolder
Remarks
You only need to touch this if you are going to use ObscuredFile / ObscuredFilePrefs from the background threads.
Methods
InitForAsyncUsage(bool)
Call this from the main thread before using ObscuredFile / ObscuredFilePrefs from the background threads.
public static void InitForAsyncUsage(bool warmUpDeviceIdentifier)
Parameters
warmUpDeviceIdentifierboolPass 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.
Remarks
Calling this method avoids getting exceptions while working with ObscuredFile / ObscuredFilePrefs from the background threads.