Click or drag to resize

Mod Class

Mod class that allows developers to trigger messages that get sent to the mod as well as access running mod hosts. See also the ModBehaviour component for mono behaviour functionality with added mod events and methods.
Inheritance Hierarchy
SystemObject
  UModMod

Namespace:  UMod
Assembly:  UMod (in UMod.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public static class Mod

The Mod type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberCommandLine
Access the mod command line arguments. This allows for parsing the command line into Uri path objects for each mod specified.
Public propertyStatic memberDefaultDirectory
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.
Public propertyStatic memberIsPlatformSupported
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).
Public propertyStatic memberIsRunningMods
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.
Public propertyStatic memberIsTrialVersion
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.
Public propertyStatic memberLogger
Get the log receiver for umod. All loaded mods will log to this receiver.
Public propertyStatic memberPersistentDataDirectory
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.
Public propertyStatic memberRunningModCount
Allows the developer to get the exact number of mods that are currently running. The mod host must be succesfully loaded to be counted.
Top
Methods
  NameDescription
Public methodStatic memberBroadcastMessage(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.
Public methodStatic memberBroadcastMessage(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.
Public methodStatic memberBroadcastMessage(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.
Public methodStatic memberGetLoadedMod(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.
Public methodStatic memberGetLoadedMod(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.
Public methodStatic memberGetLoadedMod(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.
Public methodStatic memberGetSharedAsyncHandler
Public methodStatic memberIsModLoaded(String)
Checks whether a mod with the specified name is currently loaded by any ModHost.
Public methodStatic memberIsModLoaded(Uri)
Checks whether the mod at the specified path is currently loaded by any ModHost.
Public methodStatic memberIsModLoaded(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.
Public methodStatic memberLoad
Load a mod from the specified Uri. A ModHost will be created to manage the mod and returned as the result. If the mod is already loaded then this method will simply return the ModHost for the loaded mod.
Public methodStatic memberLoadAll
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.
Public methodStatic memberLoadAllAsync
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.
Public methodStatic memberLoadAsync
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.
Public methodStatic memberLoadBatch
Load all mods from the specified paths. A ModHost will be created for each path specified.
Public methodStatic memberLoadBatchAsync
Load a mod from the specified Uri asynchronously. A ModHost will be created to manage the mod and returned as the result of the async operation. The async operation will not be complete until all mods have finished loading.
Public methodStatic memberParseAndLoadCommandLine
Parse all mod paths from the command line and load all mods.
Public methodStatic memberParseAndLoadCommandLineAsync
Parse all mods from the command line and load asll asynchronously.
Public methodStatic memberUnloadAllMods
Accesses all loaded mods and calls UnloadMod(Boolean) to free the host. Helper method to quickly unload all loaded mods.
Public methodStatic memberUnloadUnusedAssets
Top
Events
  NameDescription
Public eventStatic memberOnLoadComplete
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.
Public eventStatic memberOnResolveReference
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.
Top
See Also