Click or drag to resize

LoadAssetsLoadOBJ Method

Note: This API is now obsolete.

Load (*.obj) file from mod assets folder and return as GameObject

Namespace:  MSCLoader
Assembly:  MSCLoader (in MSCLoader.dll) Version: 1.1.5.190
Syntax
C#
[ObsoleteAttribute("LoadOBJ is deprecated, please use AssetBundles instead.", 
	true)]
public static GameObject LoadOBJ(
	Mod mod,
	string fileName,
	bool collider = true,
	bool rigidbody = false
)
Request Example View Source

Parameters

mod
Type: MSCLoaderMod
Mod instance.
fileName
Type: SystemString
File name to load from assets folder (for example "beer.obj")
collider (Optional)
Type: SystemBoolean
Apply mesh collider to object
rigidbody (Optional)
Type: SystemBoolean
Apply rigidbody to object to affect gravity (don't do it without collider)

Return Value

Type: GameObject
Returns unity GameObject
Examples
Example Code
C#
1public class ExampleMod : Mod
2{
3    //Load simple object (collider default)
4    GameObject obj = LoadAssets.LoadOBJ(this, "object.obj");
5    //Load object without collider
6    GameObject obj = LoadAssets.LoadOBJ(this, "object.obj", false);    
7    //Load object with Rigidbody
8    GameObject obj = LoadAssets.LoadOBJ(this, "object.obj", true, true);
9}
See Also