Last active
September 2, 2019 19:01
-
-
Save MarcoMeter/7ca803a5c4dcfabb4037728eddb5c95a to your computer and use it in GitHub Desktop.
This Editor Extenstion allows users to right-click on directories inside the Assets folder to compile their CSharp source files to an assembly. That assembly can be loaded and executed on run-time. Be aware that the .net Version has to be set to 2.0 inside the PlayerSettings of Unity.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class AssemblyLoader : MonoBehaviour | |
{ | |
void Start () | |
{ | |
var assembly = System.Reflection.Assembly.LoadFrom("BCD.dll"); | |
var typeA = assembly.GetType("TriangleBehavior"); | |
gameObject.AddComponent(typeA); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment