Skip to content

Latest commit

 

History

History
24 lines (16 loc) · 2.17 KB

README.md

File metadata and controls

24 lines (16 loc) · 2.17 KB

unity-project-template

Last updated March 23rd, 2022

A Unity project template for Heynow Games.

I like seperating my game logic from UI. This template represents the current state of my understanding on how to make that separation in a Unity project. Here's what it has:

  1. Latest Unity 2022 beta sample project at {clone-root}/Project using Lurking-Ninja's approach for laying out the project: "I keep a _<projectname> folder, where my stuff lives, outside of this the plugins and assets can go haywire if they want. I don't care." (Ref: This Unity Forum Post)
  2. A "GameEngine" directory at {clone-root}/GameEngine/src separated completely from the Unity Project. This allows independent development and testing of the game's logic. The Unity project integrates with it via a debugable .dll Plugin. The Engine is "pure dotnet", no UI.
  3. Using cs-util-com/cscore's Redux-like Immutable Datastore to handle model, store, actions, and reducers.
  4. xUnit.net based unit testing at {clone-root}/GameEngine/test for the GameEngine (using Getting Started with xUnit.net as a setup guide.
  5. A dotnet console app at {clone-root}/Console for interaction with the GameEngine, again, separate from Unity. Allowing for an independent "front end" to the GameEngine which validates the GameEngine as purely a backend without Unity dependencies. The Console is using the Command Line Parser nuget package to provide a REPL to interact with the GameEngine.
  6. An example omnisharp.json file (example.omnisharp.json) which can be placed at ~/.omnisharp/omnisharp.json or in your project's tree for a consistent coding style.

Have a look at the merged PR descriptions for some further details about these features.

(this needs refinement) To put the GameEngine's .dll into the Unity project (at {clone-root}/Project):

cd {clone-root}/GameEngine/src
dotnet publish -c Debug -o ../../Project/Assets/_Project/Plugins