Mod Class |
Namespace: UMod
public static class Mod
The Mod type exposes the following members.
Name | Description | |
---|---|---|
CommandLine |
Access the mod command line arguments.
This allows for parsing the command line into Uri path objects for each mod specified.
| |
DefaultDirectory |
Get the uMod default directory where mods can be installed.
This is equivilent to 'Application.persistentDataPath + "/Mods"'.
This directory will be used by default to load references and command line mods.
| |
IsPlatformSupported |
Returns true if the current runtime platform is supported by uMod.
When in editor play mode, this value will return true.
Only desktop platforms are supported (Windows, Mac linux).
| |
IsRunningMods |
Allows the developer to determine whether any mods are currently running.
Atleast one mod host must be successfully loaded for this property to be true.
| |
IsTrialVersion |
Returns true if the current version of uMod is running in trial mode.
When in trial mode, uMod 2.0 cannot be used in release builds and the scripting system is disabled.
| |
Logger |
Get the log receiver for umod. All loaded mods will log to this receiver.
| |
PersistentDataDirectory |
The folder location where uMod will store persistent data for mods.
By default this directory will be set to 'Application.persistentDataPath + "/Data/UMod"' but can be changed using the property setter.
| |
RunningModCount |
Allows the developer to get the exact number of mods that are currently running.
The mod host must be succesfully loaded to be counted.
|
Name | Description | |
---|---|---|
BroadcastMessage(String) |
Allows the developer to trigger an event that mod classes may listen to.
Works in a similar way to the 'SendMessage' method of Unity but the message will only be sent to modded scripts.
Allows the developer to implement event callbacks similar to mono behaviour messages such as OnTriggerEnter.
| |
BroadcastMessage(String, Object) |
Allows the developer to trigger an event that mod classes may listen to.
Works in a similar way to the 'SendMessage' method of Unity but the message will only be sent to modded scripts.
Allows the developer to implement event callbacks similar to mono behaviour messages such as OnTriggerEnter.
This overload allows a single value to be passed as an argument.
| |
BroadcastMessage(String, Object) |
Allows the developer to trigger an event that mod classes may listen to.
Works in a similar way to the 'SendMessage' method of Unity but the message will only be sent to modded scripts.
Allows the developer to implement event callbacks similar to mono behaviour messages such as OnTriggerEnter.
This overload allows an undefined number of values to be apssed as arguments.
| |
GetLoadedMod(String) |
Attempts to get the ModHost for a loaded mod with the specified name.
If the mod is not loaded then the return value will be null.
| |
GetLoadedMod(Uri) |
Attempts to get the ModHost for a loaded mod at the specified path.
If the mod is not loaded then the return value will be null.
| |
GetLoadedMod(String, String) |
Attempts to get the ModHost for a loaded mod with the specified name and version.
If a mod with the same name but different version is loaded then the return value will still be null (Explicit match).
If the mod is not loaded then the return value will be null.
| |
GetSharedAsyncHandler | ||
IsModLoaded(String) |
Checks whether a mod with the specified name is currently loaded by any ModHost.
| |
IsModLoaded(Uri) |
Checks whether the mod at the specified path is currently loaded by any ModHost.
| |
IsModLoaded(String, String) |
Checks whether a mod with the specified name and version is currently loaded by any ModHost.
If a mod with a matching name is found but the version is not the same then the return value will be false.
| |
Load | ||
LoadAll |
Loads all mods that are installed in the ModDirectory.
A ModHost will be created for each path specified.
If no mods are installed then this method will return an empty array.
| |
LoadAllAsync |
Loads all mods that are installed in the ModDirectory asynchronously.
A ModHost will be created to manage the mod and returned as the result of the async operation.
If no mods are installed then this method will return an empty array.
The async operation will not be complete until all mods have finished loading.
| |
LoadAsync |
Load all mods from the specified paths asynchronously.
A ModHost array will be created to manage the mod and returned as the result of the async operation.
| |
LoadBatch |
Load all mods from the specified paths.
A ModHost will be created for each path specified.
| |
LoadBatchAsync | ||
ParseAndLoadCommandLine |
Parse all mod paths from the command line and load all mods.
| |
ParseAndLoadCommandLineAsync |
Parse all mods from the command line and load asll asynchronously.
| |
UnloadAllMods |
Accesses all loaded mods and calls UnloadMod(Boolean) to free the host.
Helper method to quickly unload all loaded mods.
| |
UnloadUnusedAssets |
Name | Description | |
---|---|---|
OnLoadComplete |
Triggered when any mod host has completed the loading process even if the load failed.
The ModHost that triggered the event will be passed as an argument.
If multiple load requests are issued, this event will be triggered for each load request.
| |
OnResolveReference |
Called during mod loading when a reference needs to be loaded but cant be resolved automatically by the loader.
This allows you to manually specify the Uri location of the referenced mod.
|