![]() String modPath = Path.GetDirectoryName(Info.Location) path to the folder where the mod dll is located The method below showcases a number of ways to load your assets into various forms of objects. In order to load our resources, we can utilise Jötunn's AssetUtils helper methods, such as LoadTexture, LoadAssetBundle, LoadAssetBundleFromResources. Once it has been added, right click the item, select properties, and set the build action to embedded resource: You may do this by right clicking a folder inside of your project, and add an existing item. The example mod's post build action is a simple XCOPY command: Embedded resourceĪnother option is to embed our resources inside the binary itself. You may have noticed that we include a postbuild command into the example mod to copy the Assets directory into the games plugin directory.Īlthough this allows for easy development iteration though being able to change assets without recompilation, it is not so easily distributable to users, and must be packaged side by side with your released plugin, and exposes your assets to being directly modified by the user. Side loading would be where the assets are packaged alongside your plugin.dll. Note: The code snippets are taken from our example mod. There are two different ways of loading your assets, commonly known as side loaded and embedded. They can be images, localization files or complete asset bundles exported from Unity to import into the game. Assets are resources imported into the game besides the dll file holding our plugin code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |