Skip to content

Entitas pure C#

Simon Schmid edited this page Oct 9, 2018 · 3 revisions

Entitas pure C# project step by step guide

  • Download Entitas from the Unity Asset Store

  • Create new C# Console Project MyGame with at least .Net 4.6

  • Add refereces to

    • Entitas.dll
    • Entitas.CodeGeneration.Attributes.dll
    • DesperateDevs.Utils.dll
  • Extract the contents of Jenny.zip to the root of your project

  • Navigate into the same folder as MyGame.csproj

  • Run mono ../Jenny/Jenny.exe and select

    • Create new Jenny.properties
    • Edit Jenny.properties
entitaspure-jenny
  • Assign the location of Jenny to Jenny.SearchPaths
Jenny.Ignore.Keys =
Jenny.SearchPaths = ../Jenny
Jenny.Plugins =
Jenny.PreProcessors =
Jenny.DataProviders =
Jenny.CodeGenerators =
Jenny.PostProcessors =
Jenny.Server.Port = 3333
Jenny.Client.Host = localhost
  • Run mono ..Jenny/Jenny.exe and select
    • Use Jenny.properties
  • Select the following plugins
    • DesperateDevs.CodeGeneration.Plugins
    • Entitas.CodeGeneration.Plugins
    • Entitas.Roslyn.CodeGeneration.Plugins
  • Select
    • Save and continue (auto import)
  • When prompted to resolve plugin collisions, please choose Entitas.Roslyn...
entitaspure-gen
  • Update Jenny.properties
DesperateDevs.CodeGeneration.Plugins.ProjectPath = MyGame.csproj
DesperateDevs.CodeGeneration.Plugins.TargetDirectory = .
  • You're all setup and you can generate now
  • Run mono ../Jenny/Jenny.exe gen
entitaspure-done
  • Add your first component and generate
using Entitas;

namespace MyGame
{
    class Program
    {
        public static void Main(string[] args)
        {
            var e = Contexts.sharedInstance.game.CreateEntity();
            e.AddHealth(100);
        }
    }
}

public sealed class HealthComponent : IComponent
{
    public int value;
}
entitaspure-folders
MyGame
├── Jenny
│   └── Plugins
│       ├── DesperateDevs
│       ├── Entitas
│       └── Entitas.Roslyn
├── Libraries
│   ├── DesperateDevs.Utils.dll
│   ├── Entitas.CodeGeneration.Attributes.dll
│   └── Entitas.dll
├── MyGame
│   ├── Generated
│   ├── Jenny.properties
│   ├── MyGame.csproj
│   ├── Program.cs
│   └── simonschmid.userproperties
└── MyGame.sln
Clone this wiki locally