-
-
Notifications
You must be signed in to change notification settings - Fork 0
Load Assets functions
piotrulos edited this page Sep 22, 2023
·
2 revisions
A small helpful API that loads Assets or Textures from your mod folder
Get a reference to Main UI Font as TMP_FontAsset
You can use this to load your custom asset bundle made in unity.
AssetBundle ab = DVModAssets.LoadAssetBundle(modEntry, "myassetbundle.unity3d");
//(...) load some stuff from asset bundle
ab.Unload(false);If you have file inside a folder just use Path.Combine()
AssetBundle ab = DVModAssets.LoadAssetBundle(modEntry, Path.Combine("Some Folder","myassetbundle.unity3d"));You can use this to load *.png file (from your mod folder) as Texture2D file.
Texture2D tex = DVModAssets.LoadTexture(modEntry, "myTexture.png");