nsacorps.blogg.se

Unity floor generator gaps
Unity floor generator gaps












unity floor generator gaps

Now, I know the new 2021 beta has C# 9 support along with the new Code Generator feature, however, I'm reluctant to use the beta because it sure is buggy and therefore frustrating. The question here is whether it is possible to write a Roslyn code generator as a Unity package. However, this solution seems most appealing to me, since it would allow me to keep the code generator as a sub-project within the main Unity project, without having to nest repositories (at least in the beginning of development, it could be trivially refactored into a separate repo via git submodule afterwards), and with the ability for my code generator to depend on Unity API's if needed. asmdef sub-projects and/or packages, however, I'm unsure whether one could distribute a Roslyn analyzer, let alone a Roslyn code generator, this way. I know Godot does this well, but I'm unsure about Unity.Īnother issue with this is that such project structure is unconventional and just confusing.ĪFAIK Unity has its own package manager and encourages structuring the project into smaller. I guess the simplest solution would be to put the code generator projects at a level with the entire Unity project folder to avoid conflicts.īut then it is not clear whether one may reference cs projects from outside the project folder and how that plays out with Unity. csproj files in Unity are autogenerated and I do not know how well it behaves with such embedded "conventional" projects.Īlso, it is not clear where such sub-projects should be located within the project structure. So, the second idea is to reference a local project with the code generator within the Unity repository, however I am not sure if this is at all possible.

unity floor generator gaps

The NuGet export indirectness will make it harder to debug the generator. The problem with this approach is that the code generator will then not be within the Unity project. Runtime build native contentfiles analyzers buildtransitive I'd like to avoid trying this myself, given it might not work at all, but I will do it anyway while awaiting an answer: I wonder how much of a hassle is it to achieve MSBuild project references like below within a Unity project.

unity floor generator gaps unity floor generator gaps

The first question is whether the code generation via a NuGet package like that will even work under Unity 2020.2 LTS. With this setup, it is easy to export the code generator as a NuGet package and import it in any other project. I have found information on how to set up a code generator correctly using CodeGeneration.Roslyn. I'm planning to use a custom Roslyn code generator in a Unity project. Can I make a Roslyn code generator a Unity package or at least an asmdef, and how? How would I use it?.How to reference "conventional" dotnet projects in Unity?.How reliable are local "conventional" projects?.How to reference custom Roslyn code generators from Unity?.














Unity floor generator gaps