Unity Roslyn Demos

January 19, 2023 ยท View on GitHub

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 MonoBehaviourDemo handling Math

Requirements

Unity 2021.3.8f1 or greater (This could work with earlier version but not tested yet)

Future improvements

  1. Documenting how to get Roslyn C# DLLs compiled with .NET Standard