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

Let Spite be cloned into a Unity Project #12

Closed greenstack closed 3 years ago

greenstack commented 3 years ago

Right now, Spite can't be directly cloned into Unity projects because the framework uses C# features not available in Unity (namely, certain C# 8.0 features). Since I want Spite to be as compatible with as many engines and frameworks as possible, I'm going to make the target Unity version Unity 2019 since that has support until 2022 (Unity 2018 loses support this year). This means that Spite should only use features available in C# 7.3 (source).

Once Unity 2019 leaves LTS in 2022, we can look into updating available language features to what Unity 2020 supports - in other words, we have Spite supporting the oldest available LTS version of Unity.

That said, I'm open to discussion for this (for example, maybe we target Unity's recommended release, which in this case is Unity 2020. This way, we keep a balance of getting to use newer language features. Maybe that's what we do once Spite gets its first full release.)

Part of the solution for this is making sure that Spite doesn't use a C# version greater than 7.3.

greenstack commented 3 years ago

Considering new projects are probably going to be using Unity 2020, however, maybe we focus on that version? I guess since I'm currently really the only one working on this, that should be fine.

greenstack commented 3 years ago

I just cloned 0.3.0-dev into a bare-bones unity project and it seems that the issues are coming from the tests directory.

greenstack commented 3 years ago

If anyone has any insight into getting an existing NUnit test to work inside a Unity Project, I would greatly appreciate the help.

greenstack commented 3 years ago

The major problem I'm running into is that Unity is struggling to find Spite when I try to create unit tests. While I could change the tests folder to tests~ to have Unity ignore it, I'm not terribly happy with this solution, as Unity still doesn't recognize Spite when I try to include it for unit tests. I know that dragging the DLL into unity works for the most part (no idea if that works with unit tests or not).

I'll try looking into how .asmdef works in Unity and maybe as a package or plugin or something.

It's a tad frustrating because I know Unity uses NUnit for its unit tests, which is what Spite uses. I'll probably reach out via the Unity forums to try and figure something out there. I'll comment with a link to the forum post when (if) that happens.

greenstack commented 3 years ago

Including files that tell Unity to treat Spite as a Package appears to have worked.

greenstack commented 3 years ago

Everything seems to be good. Closing this issue!