Preparing your project


You need a fairly recent version of Unity3D, currently ECS requires at least the latest preview version of Unity 2019.1, 2019.2 should also be fine. I have tested these instructions with Unity 2019.1.0b6.

Installing the dependencies

Unity ECS is currently in preview, which means that you first need to enable the use of preview packages in Unity’s package manager. So open Unity’s package manager using Window -> Package Manager, then click on the Advanced button and enable Show preview packages.

Show preview packages in package manager.
Show preview packages in package manager.

Then install the following packages:

  • Entities
  • Hybrid Renderer

Installing these two packages will automatically install of the additional dependencies (like Mathematics) as well. After this you may need to reimport the project so that the installed packages are properly picked up by Unity.

Preparing the assembly definitions

After the dependencies are installed, you need to prepare assembly definitions so you can access the Unity ECS API. To do so create a folder for your scripts (e.g. named Scripts), then right-click and choose Create -> Assembly Definition. In the Assembly Definition References section add the following references:

  • Unity.Entities
  • Unity.Entities.Hybrid
  • Unity.Rendering.Hybrid
  • Unity.Collections
  • Unity.Mathematics
  • Unity.Transforms
Set up the assembly definition references.
Set up the assembly definition references.

Now you can begin writing code with the Unity ECS API.