Click or drag to resize

ModLoaderGetModAssetsFolder Method

Mod assets folder, use this if you want load custom content.

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

Parameters

mod
Type: MSCLoaderMod
Your mod Class.

Return Value

Type: String
Path to your mod assets folder
Examples
Example Code in Mod subclass.
C#
1public class ExampleMod : Mod
2{
3    string path = ModLoader.GetModAssetsFolder(this); //Will return your mod assets folder
4    //(...)
5    string path = Path.Combine(ModLoader.GetModAssetsFolder(this), "somefile.png");
6    //or with folder
7    string path = Path.Combine(ModLoader.GetModAssetsFolder(this), @"Some Folder/somefile.png");
8    //(...)
9}
Example from other than Mod subclass.
C#
1public class ExampleClass : MonoBehaviour
2{
3    string path = ModLoader.GetModAssetsFolder(new ExampleMod()); //Will return your mod assets folder
4    //(...)
5    string path = Path.Combine(ModLoader.GetModAssetsFolder(new ExampleMod()), "somefile.png");
6    //or with folder
7    string path = Path.Combine(ModLoader.GetModAssetsFolder(new ExampleMod()), @"Some Folder/somefile.png");
8    //(...)
9}
See Also