Table of Contents

Class ResourceManager

Namespace
SharpPluginLoader.Core
Assembly
SharpPluginLoader.Core.dll

Provides access to the game's resource manager (sMhResource)

public static class ResourceManager
Inheritance
ResourceManager
Inherited Members

Properties

SingletonInstance

The sMhResource singleton instance.

public static MtObject SingletonInstance { get; }

Property Value

MtObject

Methods

GetResource<T>(string, MtDti, LoadFlags)

Gets a resource from the game's resource manager.

If the resource is already loaded, it will return the existing instance. Otherwise, it will attempt to load the resource from the specified path. Files in nativePC take precedence over files in the chunks.

public static T? GetResource<T>(string path, MtDti dti, LoadFlags flags = LoadFlags.Blocking) where T : Resource, new()

Parameters

path string

The path to the file, relative to the chunk root and without the extension

dti MtDti

The dti of the file to load

flags LoadFlags

Flags to pass on to the function

Returns

T

The resource if it was found, or null

Type Parameters

T

The type of the resource to get. Use Resource if there is no dedicated type in the framework for the resource you're trying to load.