Click or drag to resize

LoadAssetsLoadBundle Method

A function for Loading AssetBundles Synchronously (without coroutines)

Namespace:  MSCLoader
Assembly:  MSCLoader (in MSCLoader.dll) Version: 1.1.5.190
Syntax
C#
public static AssetBundle LoadBundle(
	Mod mod,
	string bundleName
)
Request Example View Source

Parameters

mod
Type: MSCLoaderMod
Mod instance.
bundleName
Type: SystemString
File name to load (for example "something.unity3d")

Return Value

Type: AssetBundle
Returns unity AssetBundle
Examples
Example based on loading settings assets.
C#
1public class ExampleMod : Mod
2{
3    AssetBundle ab = LoadAssets.LoadBundle(this,"something.unity3d");
4    GameObject go = ab.LoadAsset("something.prefab") as GameObject; 
5
6    //IMPORTANT: Unload will allow bundle to load again when go back to MainMenu
7    ab.Unload(false);
8}
See Also