Editing General modding
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 7: | Line 7: | ||
Second, only one script can inherit from the IModInterface abstract class. This is because this script acts as an entrance point to all scripting logic in your mod, similar to how the Program class is usually the entrance point in C# projects. The IModInterface has several overridable methods, such as the "OnIngameUpdate" method (similar to Update), which allows you to hook logic to in game events. You can, however, have as many classes in your project as you like. And your entrance point IModInterface script can reference any of these classes. | Second, only one script can inherit from the IModInterface abstract class. This is because this script acts as an entrance point to all scripting logic in your mod, similar to how the Program class is usually the entrance point in C# projects. The IModInterface has several overridable methods, such as the "OnIngameUpdate" method (similar to Update), which allows you to hook logic to in game events. You can, however, have as many classes in your project as you like. And your entrance point IModInterface script can reference any of these classes. | ||
β | Another limitation, one that I had trouble with initially, is that scripts attached to GameObjects in Additive scenes will NOT BE CALLED. This limitation is due to the way your mod assembly gets loaded into the game at runtime. But you can always attach a MonoBehaviour derived script to a GameObject. | + | Another limitation, one that I had trouble with initially, is that scripts attached to GameObjects in Additive scenes will NOT BE CALLED. This limitation is due to the way your mod assembly gets loaded into the game at runtime. But you can always attach a MonoBehaviour derived script to a GameObject. You can also create a Prefab, and load it Dynamically into the game. |
β | + | I haven't tried attaching a MonoBehaviour to a prefab, and then loading it Dynamically through script. This may be another limitation. | |
A temporary limitation, one that the developers hope to fix in the future, is that you can't use DLLs (Dynamically Linked Library) from the Asset Store or from other projects in your mod. All of the code in your mod must be C# Files. Be wary of this when you import Assets from the Unity Asset Store. | A temporary limitation, one that the developers hope to fix in the future, is that you can't use DLLs (Dynamically Linked Library) from the Asset Store or from other projects in your mod. All of the code in your mod must be C# Files. Be wary of this when you import Assets from the Unity Asset Store. |