-
Notifications
You must be signed in to change notification settings - Fork 0
Creating Your Own Module For VeRidium
Thank you for contributing to VeRidium! This page explains how to create a new module for VeRidium. If you want to contribute in some other way, talk to us first, because collaborating in Unity via Git can get a little bit complicated in some cases.
If you haven't already done so, create your own fork of VeRidium, so you have a Repository to work in and set it up. We explain this in detail here.
We explain how to get your changes into the main project later.
-
In VeRidium, all files belonging to a Module should be in the same folder. First, create a folder named liked your module for your module inside
Assets/Modules
, soAssets/Modules/<YourModuleName>
. You only ever want to commit changes you made inside this folder. You or the Unity Editor might change files outside this folder, but please don't commit them with git to avoid merge conflicts later. -
Once you have a folder for your Module, you need a (main) scene for your module. Create a scene at
Assets/Modules/<YourModuleName>/<YourModuleName>.unity
This scene needs to have the same file name as your module name. You module can consist of multiple scenes, but this will be the Scene that is loaded when starting your module from the main menu. -
In order for your module to be visible in the main menu, it needs a module prefab. Create a folder called
Resources
inside your module folder. Inside this Module create a Prefab Variant ofAssets/Prefabs/Module.prefab
. The prefab variant also needs to have the same name as your module. Your module prefab should now be atAssets/Modules/<YourModuleName>/Resources/<YourModuleName>.prefab
. -
You can now customize your module name and description. On the Root Object of your module prefab, there should be a
VeridiumModule
script. There you can edit the name and description that will be shown in the main menu.
You can also customize your prefab visually by adding things, but dont delete anything and make sure the added objects don't have any physics / collision. -
If you now try to build, you might notice that your module does not appear in the main menu. To fix that, you need to add your scene to the build. To do that, open your module scene and click "Add Open Scenes" in the Build Settings:
If you add more scenes to your module, also add them in this way.
Note that this changes theBuildSettings.json
outside the module folder. Keep it that way, but don't commit it.
You now have set up your own module that can be loaded from the main menu. You can now create whatever you want!
In case you have any problems, just talk to us.
Once your module is done, you can add it to the main repository via pull request. Create a pull request describing you module on the main repository. We will review it and give feedback as soon as possible and get it into the next release once everything works! :)