Unity demos with Roslyn C# compiler tools which allow you to compile and inspect C# code at runtime.
I've created couple of Unity scenes which demonstrate how to use the RoslynCodeRunner.cs which currently provides you with the following options shown on the inspector image below:
Demo creating a MonoBehaviour | Demo handling Math |
---|---|
Unity 2021.3.8f1 or greater (This could work with earlier version but not tested yet)
- Documenting how to get Roslyn C# DLLs compiled with .NET Standard