Changes

Jump to navigation Jump to search
Line 22: Line 22:     
The ModMeta class will contain information about your mod and act as a manager for your mod.
 
The ModMeta class will contain information about your mod and act as a manager for your mod.
<pre>
+
<pre class="language-cs">namespace myMod  
namespace myMod  
   
{
 
{
 
   internal class MyModMeta : ModMeta
 
   internal class MyModMeta : ModMeta
Line 37: Line 36:  
         public override string Name => "My Mod!";
 
         public override string Name => "My Mod!";
 
     }
 
     }
}
+
}</pre>
</pre>
      
ModBehaviours are just a subclass of Unity's [https://docs.unity3d.com/2017.4/Documentation/ScriptReference/MonoBehaviour.html MonoBehavior] and work the same way, i.e. they use the same life cycle of Awake, Start, Update, OnDestroy, ModBehaviours only differ in that they have the abstract OnActive and OnDeactivate methods, to signal when the mod is toggled. Each ModBehaviour implementation will be instantiated once the mod is loaded.
 
ModBehaviours are just a subclass of Unity's [https://docs.unity3d.com/2017.4/Documentation/ScriptReference/MonoBehaviour.html MonoBehavior] and work the same way, i.e. they use the same life cycle of Awake, Start, Update, OnDestroy, ModBehaviours only differ in that they have the abstract OnActive and OnDeactivate methods, to signal when the mod is toggled. Each ModBehaviour implementation will be instantiated once the mod is loaded.

Navigation menu