ScriptReference/PlayerSettings.GetPreloadedAssets #615
Replies: 1 comment
-
|
The example code included has one minor flaw, notably, preloaded assets are only preloaded in builds, and not when in the editor (as of 2022.3). Calling The provided example code can be fixed by adding this small bit of code to ensure assets are loaded when the editor is restarted: #if UNITY_EDITOR
[InitializeOnLoadMethod]
public static void EditorInitializeOnLoad()
{
// Force unity to load preloaded assets on editor start
_ = PlayerSettings.GetPreloadedAssets();
}
#endif |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
ScriptReference/PlayerSettings.GetPreloadedAssets
https://docs.unity3d.com/ScriptReference/PlayerSettings.GetPreloadedAssets.html
Beta Was this translation helpful? Give feedback.
All reactions