Click or drag to resize

ModBehaviour Class

The mod behaviour class is a substitue for the mono behaviour class that provides additional information to the developer. By default all public members of the inheriting class will be exposed to modders. The developer must inherit from this class if they want to support inheritance.
Inheritance Hierarchy
SystemObject
  Object
    Component
      Behaviour
        MonoBehaviour
          UModModBehaviour

Namespace:  UMod
Assembly:  UMod (in UMod.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public abstract class ModBehaviour : MonoBehaviour

The ModBehaviour type exposes the following members.

Constructors
  NameDescription
Protected methodModBehaviour
Initializes a new instance of the ModBehaviour class
Top
Properties
  NameDescription
Public propertyActiveHost
Returns a reference to the active ModHost instance in the scene. Always the first host created.
Public propertyHosts
Returns an array of mod hosts that are currently in the scene.
Public propertyIsModLoaded
Returns true if a valid host exists in the scene and currently has a mod loaded.
Top
Methods
  NameDescription
Public methodBroadcastModMessage(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. An example would be triggering a game over message to inform the mod that the game has ended.
Public methodBroadcastModMessage(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. This overload allows a single value to be passed as an argument. An example would be triggering a game over message to inform the mod that the game has ended.
Public methodBroadcastModMessage(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. This overload allows an any number of values to be passed as arguments, Referenced Unity types are allowed. An example would be triggering a game over message to inform the mod that the game has ended.
Protected methodOnModLoaded
Event method triggered when a mod host has successfully loaded a mod. This method provides the same callback behaviour as subscribing to the OnLoadComplete event.
Protected methodOnModUnloaded
Event method triggered when a mod host has successfully un-loaded a mod. This method provides the same callback behaviour as subscribing to the OnModUnloaded event.
Public methodVirtualMessage(String)
Allows the developer to trigger a callback that inheriting mod classes may listen for. Works in a similar way to the 'SendMessage' method of Unity except that only mod classes inheriting from this class can be triggered. An example would be triggering a damage message to indicate to modders that this object is taking damage.
Public methodVirtualMessage(String, Object)
Allows the developer to trigger a callback that inheriting mod classes may listen for. Works in a similar way to the 'SendMessage' method of Unity except that only mod classes inheriting from this class can be triggered. This overload allows a single argument to be passed. An example would be triggering a damage message to indicate to modders that this object is taking damage.
Public methodVirtualMessage(String, Object)
Allows the developer to trigger a callback that inheriting mod classes may listen for. Works in a similar way to the 'SendMessage' method of Unity except that only mod classes inheriting from this class can be triggered. This overload allows an undefined number of arguments to be passed. An example would be triggering a damage message to indicate to modders that this object is taking damage.
Top
See Also