After a few starter projects, I'm starting on my first bigger piece of work - a roguelike CCG.
For card behaviour scripts, I'm wanting to stick with C# if possible, so have used a combo of the NuGetForUnity upm package and the CSharpScripting package, giving runtime C# compilation with the Roslyn compiler.
The basic setup works, but I've run into two issues:
- If I run the script with "EvaluateAsync", it's slow, and runs into an issue I've seen online with non-Unity users where it essentially loads single-use assemblies into the game, leading to memory leak issues. Not great
- If I run using the "Create", "Compile" and "RunAsync" commands, it seems to keep hold of the Assembly-CSharp.dll between Unity runs, so I need to close the editor every time I change the code. Presumably won't be good for packaged-up version of the game.
So I guess I have a few questions based on this:
- Does this approach work, and if so how to solve the issue?
- If not, what are the best (free + license free) alternatives? Any that still use C#, or go to Lua/JS etc.?
- Is NuGetForUnity work using at all? I'm a full time C# dev so it was pretty appealing but don't know it's reliability