Skip to content
piotrulos edited this page Apr 7, 2023 · 4 revisions

Mod Class

The base mod class, all mods should have this class.

Inheritance Hierarchy

System.Object
  MSCLoader.Mod
    MSCLoader.ModConsole
Namespace: MSCLoader
Assembly: MSCLoader (in MSCLoader.dll) Version: 1.2.11.286

Syntax

C#

public abstract class Mod

View Source
The Mod type exposes the following members.

Constructors

 

Name Description
Public method Mod pro BS
  Back to Top

Properties

 

Name Description
Public property Author Author of the mod (Enter your nickname in this variable)
Public property Description Short Description of your mod
Public property Icon Mod Icon from Resources or Embedded Resources.
Public property ID The ID for your mod (This should be unique).
Public property isDisabled true if mod is disabled
Public property LoadInMenu Load this mod in Main Menu.
Public property Name The name of mod that will be displayed in settings. (if not set, will be same as ID)
Public property SecondPass Enable SecondPassOnLoad() that will execute after all mods have been loaded.
Public property UseAssetsFolder Set this to true if you want load custom files from Assets folder (This will create a subfolder for your mod)
Public property Version The current version of the mod. (prefered standard version format: 2, 3 or 4 digits)
  Back to Top

Methods

 

Name Description
Public method FixedUpdate Called once every fixed frame (standard unity FixedUpdate()).
Public method ModSettings All settings should be created here.
Public method ModSettingsLoaded Called after saved settings habe been loaded from file.
Public method ModSetup Setup your mod.
Public methodCode example OnGUI Standard unity OnGUI().
Public method OnLoad Called once, after GAME scene is fully loaded.
Public method OnMenuLoad Called once in main menu (only when LoadInMenu is true).
Public method OnModDisabled Called once when mod has been disabled in settings
Public method OnModEnabled Called once when mod has been enabled in settings
Public method OnNewGame Called once after starting "New Game" You can reset/delete your saves here
Public method OnSave Called once, when save and quit.
Public method PreLoad Called once as soon as GAME scene is loaded.
Public method SecondPassOnLoad Called once, after ALL mods has finished OnLoad() and when SecondPass is set to true (Executed still before first pass of Update(), but NOT exectued if OnLoad() failed with error)
Public method SetupFunction Setup selected function for your mod
Public method Update Called once every frame (standard unity Update()).
  Back to Top

See Also

Reference

MSCLoader Namespace

Clone this wiki locally