greenstack / spite-framework

The Spite Framework is a C# library meant to simplify designing and implementing turn-based gameplay by providing some boilerplate code.
MIT License
6 stars 0 forks source link

Resources don't work with Unity #55

Open greenstack opened 2 years ago

greenstack commented 2 years ago

A lot of exception messages are used in Spite that depend on the .NET resources functionality. However, since Unity can't use these, when an exception is thrown by Spite, the runtime can't find the proper resource for the message, which throws another exception, burying the original exception under another (in fact, the only way to figure out what the original exception was is to look at the code where the new exception was thrown from). This happens when Spite is included as a package (with source code). Even should this not be the case when using Spite.dll in Unity, this greatly increases the difficulty of using Spite in Unity.

greenstack commented 2 years ago

For a workaround, I'm using #if ... #endif guards for the error messages. I think the best option in the long run would be to introduce a permanent constant for each class.

greenstack commented 2 years ago

I meant to link 1aef5cdd with this issue, but I linked it with another one instead.

That commit was merged into 0.4.x-dev to bring a quick fix to others that might be using the framework. This issue isn't quite finished yet.