-
Notifications
You must be signed in to change notification settings - Fork 3
Mods Getting started
Before start this getting started, please read our introduction to Buildron mods.
Download the Buildron for your platform (Linux, Mac or Win) and the ModSdk from our releases page. Unzip Buildron in any folder, for example: C:\Buildron.
Open your IDE (Visual Studio / Xamarin Studio) and create a new C# class library project called "TestMod".
In the properties/options of the project change the target framework to .NET 3.5 (we need to be compatible with Unity3d).
In the project references, add the reference to:
- UnityEngine.dll (more about reference UnityEngine.dll)
- Mac: /Applications/Unity/Unity.app/Contents/Managed/
- Win: C:\Program Files\Unity\Editor\Data\Managed
- Buildron.Sdk.dll
In the root folder of your project add a class file called Mod with the following code.
using Buildron.Domain.Mods;
using UnityEngine;
namespace TestMod
{
public class Mod : IMod
{
public void Initialize(IModContext context)
{
context.BuildStatusChanged += (sender, e) =>
{
var cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
cube.transform.position = new Vector3(Random.Range(-5, 5), 30, Random.Range(-1, 1));
cube.AddComponent<Rigidbody>();
};
}
}
}
Compile the project.
Create a subfolder called "TestMod" inside Buildron mods folder:
- Mac: Buildron.App\Mods (the "Mods" should be inside Buildron.app. Choose "Show package contents")
- Linux and Win: "Mods" folder should be in same folder of Buildron executable.
Then copy your project assembly "TestMod.dll" from your bin\Debug folder to your "TestMod" subfolder inside Buildron mods folder. Ex.: c:\Buildron\Mods\TestMod\TestMod.dll
Start Buildron, click on "Play" button. Now, every time a build status changed your mod will create a falling cube inside Buildron.
This was just a getting started to show how easy and fast you can create a mod to Buildron. If you want to build more sofisticated mods, with Unity3d assets and a faster development flow, please take a look on our tutorial "Creating a mod".