Search Results for

    Show / Hide Table of Contents

    Class ModBehaviour

    Inheritance
    object
    UnityEngine.Object
    UnityEngine.Component
    UnityEngine.Behaviour
    UnityEngine.MonoBehaviour
    ModBehaviour
    Namespace: Global
    Assembly: Dew.Core.dll
    Syntax
    public class ModBehaviour : MonoBehaviour

    Fields

    instance

    Declaration
    [NonSerialized]
    public LoadedModInstance instance
    Field Value
    Type Description
    LoadedModInstance

    Properties

    harmony

    Declaration
    public Harmony harmony { get; }
    Property Value
    Type Description
    HarmonyLib.Harmony

    mod

    Declaration
    public ModItem mod { get; }
    Property Value
    Type Description
    ModItem

    modConfigFields

    Declaration
    public FieldInfo[] modConfigFields { get; }
    Property Value
    Type Description
    System.Reflection.FieldInfo[]

    Methods

    CallOnManager<T>(Action, Action)

    Declaration
    public void CallOnManager<T>(Action onEnable, Action onDisable = null) where T : ManagerBase<T>
    Parameters
    Type Name Description
    System.Action onEnable
    System.Action onDisable
    Type Parameters
    Name Description
    T

    CallOnNetworkedManager<T>(Action, Action)

    Declaration
    public void CallOnNetworkedManager<T>(Action onStartClient, Action onStopClient = null) where T : NetworkedManagerBase<T>
    Parameters
    Type Name Description
    System.Action onStartClient
    System.Action onStopClient
    Type Parameters
    Name Description
    T

    GetConsoleSelectedEntity()

    Declaration
    protected static Entity GetConsoleSelectedEntity()
    Returns
    Type Description
    Entity

    GetModConfigFilePath(FieldInfo)

    Declaration
    public virtual string GetModConfigFilePath(FieldInfo modConfigInfo)
    Parameters
    Type Name Description
    System.Reflection.FieldInfo modConfigInfo
    Returns
    Type Description
    string

    LoadConfigsToDisk()

    Declaration
    public virtual void LoadConfigsToDisk()

    MakeSureClientNonServer()

    Returns false and logs to console if user is not a non-server client.
    Meant to be used in custom console commands.

    Declaration
    protected static bool MakeSureClientNonServer()
    Returns
    Type Description
    bool

    MakeSureInGame()

    Returns false and logs to console if not in a game.
    Meant to be used in custom console commands.

    Declaration
    protected static bool MakeSureInGame()
    Returns
    Type Description
    bool

    MakeSureNetworked()

    Returns false and logs to console if not in a networking context.
    Meant to be used in custom console commands.

    Declaration
    protected static bool MakeSureNetworked()
    Returns
    Type Description
    bool

    MakeSureNotInGame()

    Returns false and logs to console if in a game.
    Meant to be used in custom console commands.

    Declaration
    protected static bool MakeSureNotInGame()
    Returns
    Type Description
    bool

    MakeSureServer()

    Returns false and logs to console if user is not a server.
    Meant to be used in custom console commands.

    Declaration
    protected static bool MakeSureServer()
    Returns
    Type Description
    bool

    OnConfigChanged()

    Declaration
    public virtual void OnConfigChanged()

    PrintNoEntitySelected()

    Declaration
    protected static void PrintNoEntitySelected()

    RegisterConsoleCommand(MethodInfo, string, string)

    Register a command by method info. The method can be either static or not.
    Command with same name and signature will get a number appended.
    The command will be automatically unregistered on mod unload.

    Declaration
    public void RegisterConsoleCommand(MethodInfo m, string customName = null, string description = null)
    Parameters
    Type Name Description
    System.Reflection.MethodInfo m
    string customName
    string description

    RegisterConsoleCommand(string, string, string)

    Register a command by method name. The method can be either static or not.
    Command with same name and signature will get a number appended.
    The command will be automatically unregistered on mod unload.

    Declaration
    public void RegisterConsoleCommand(string methodName, string customName = null, string description = null)
    Parameters
    Type Name Description
    string methodName
    string customName
    string description

    SaveConfigsToDisk()

    Declaration
    public virtual void SaveConfigsToDisk()

    TryGetConsoleSelectedEntity(out Entity)

    Declaration
    protected static bool TryGetConsoleSelectedEntity(out Entity ent)
    Parameters
    Type Name Description
    Entity ent
    Returns
    Type Description
    bool

    Extension Methods

    DewGUI.SetExpandHeight<T>(T, bool)
    DewGUI.SetExpandHeight<T>(T, float)
    DewGUI.SetExpandWidth<T>(T, bool)
    DewGUI.SetExpandWidth<T>(T, float)
    DewGUI.SetHeight<T>(T, float)
    DewGUI.SetText<T>(T, string)
    DewGUI.SetTextLocalized<T>(T, string)
    DewGUI.SetWidth<T>(T, float)
    In This Article
    Back to top Shape of Dreams API Documentation