Apart from loading 3d models (like .fbx files), the new Plugin API is also capable of loading Unity Asset bundles. Asset bundles may contain prefabs using almost any Unity component, e.g. custom models, custom materials and shaders, particle effects and also physical components. Only scripts are not supported (because the game uses IL2CPP which can't load new assemblies during runtime).
While this is an extremely powerful feature, it has a few limitations unfortunately. On the one hand, certain things like shaders are always platform-dependent. This means that they need to be compiled for Windows, Mac and Linux, resulting in separate bundles per platform. On the other hand, it's necessary to use the same editor version as the game (as of 0.6.7, this is Unity 2022.2.21f1 - typically you can find the current Unity version in the plugin changelog of an update).
To overcome the first issue (platform-dependent bundles), Rising World supports "multi-platform asset bundles", i.e. single asset bundle files containing data for all supported platforms. To build such an asset bundle, we're providing a separate Unity package that can be imported in your Unity project - it provides an editor script to build the required bundle(s).
Please note: Using Unity is optional. You can still load models and textures directly from your hard drive. You only need Unity if you want to build asset bundles containing Unity Prefabs, which give you a lot more freedom and control.
How to install
- First of all, you have to download the same Unity version as the game. Currently the game uses Unity 2022.2.21f1. It's recommendable to install the Unity Hub for this.
- Make sure to install "Linux Build Support (Mono)" and "Mac Build Support (Mono)" (so you can build asset bundles for these platforms). If you don't use the hub, you can download and install the components manually from here
- After installing the Hub, create a new HDRP project
- Click on the blue "New project" button in the top right corner
- Important: Select "3D (HDRP)" (it may be necessary to download the template first by hitting the right "Download template" button)
- Provide a project name on the right side (e.g. "Rising World Plugin") and an optional project path
- Hit "Create project" - this should load the project automatically
- After opening the project, the HDRP Wizard may show up (which is typically not required in our case). Disable "Show on start" at the bottom and close the wizard
- Hit "Assets" in the top menu bar ➞ Import Package ➞ Custom Package...
- Locate the PluginSDK.unitypackage (you can find it in the game directory under "Data/SDK/PluginSDK.unitypackage") and import it
- Make sure everything is selected and hit "Import"
- It may bring up a dialog "Fix Layers" - it enables you to overwrite the currently set up layers to match the game layers. Hit "Fix now"
- Now there should be a new "AssetBundles" folder in your project (in "Assets").
You can create subfolders there for each asset bundle you want to create (more precisely, each subfolder will result in a separate asset bundle). The package already contains an "ExampleBundle" folder with an example VFX effect.
- To build the asset bundles, hit "PluginSDK" at the top ➞ Build Asset Bundles. This builds all asset bundles into the "Build" folder in the project directory