Skip to content

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

DVModAssets.MainUIFont

Get a reference to Main UI Font as TMP_FontAsset

DVModAssets.LoadAssetBundle

You can use this to load your custom asset bundle made in unity.

Example

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"));

DVModAssets.LoadTexture

You can use this to load *.png file (from your mod folder) as Texture2D file.

Example

Texture2D tex = DVModAssets.LoadTexture(modEntry, "myTexture.png");

Clone this wiki locally