2 ms·
This is fascinating! Code generation is a thing that's solved a couple problems for me recently. The way I do it never feels great. Whenever I want to cache a b
by MrLeap 2y ago
This is fascinating! Code generation is a thing that's solved a couple problems for me recently. The way I do it never feels great. Whenever I want to cache a big dictionary literal, I tend to generate the code as a string and write it to a file. I've yet to find a compelling upgrade that checks all the boxes. (The generated side has run in the kneecapped .net for unity, although the generator doesn't necessarily.)
I'm going to dig into your implementation.
- kkukshtel 2y agoYou could source generate this directly into your code instead of dealing with file IO. Newer versions of Unity support source generators: https://docs.unity3d.com/6000.0/Documentation/Manual/create-source-generator.html https://docs.unity3d.com/6000.0/Documentation/Manual/create-...