Skip to content

Getting started

AntonKalatski edited this page Feb 26, 2024 · 4 revisions

Notice: ME.BECS requires Unity 2023.1 or later.

  • Add csc.rsp file into your projects root folder (Assets), add corresponding defines:
-define:EXCEPTIONS_CONTEXT
-define:EXCEPTIONS_THREAD_SAFE
-define:EXCEPTIONS_COLLECTIONS
-define:EXCEPTIONS_COMMAND_BUFFER
-define:EXCEPTIONS_ENTITIES
-define:EXCEPTIONS_QUERY_BUILDER
-define:EXCEPTIONS_INTERNAL
-define:EXCEPTIONS
  • Add required dependencies to your project:
"com.unity.collections": "2.1.4",
"com.unity.ui": "2.0.0",
"com.unity.jobs": "0.70.0-preview.7",
"com.unity.burst": "1.8.12",
"com.unity.mathematics": "1.2.6",
"com.unity.profiling.core": "1.0.2",
  • Install via UPM

In unity editor use the Unity Package Manager (top menu: Window > Package Manager)

Open the add image12 menu.

Choose Add package from git URL option.

image2

Paste git url into this line and click install.

image11

  • Manual installation (using .unitypackage)

You can find the latest .unitypackage on the releases page, download it and then import into your project as any other .unitypackage

  • Allow unsafe code in your project.

Navigate to Edit > ProjectSettings > Player > OtherSettings (DropDown), and under “Additional Compiler Arguments section tick “Allow ‘unsafe’ code”.

image8
  • Create your project

Right click in your project tab Create > ME.BECS > Create Project

image2

Enter the name of your project folder (ProjectName). This automatically generates the projects folder and all the necessary files, also - (ProjectName)Initializer prefab will appear on your scene.

image11 image6
image2
  • Create your HelloWorldSystem

Notice: All aspects, components, systems and other elements have to be created inside the (ProjectName) folder!

using ME.BECS;
using UnityEngine;

namespace HelloWorldProject.System
{
    public unsafe struct HelloWorldSystem : IAwake
    {
        public void OnAwake(ref SystemContext context)
        {
            Debug.Log($"Hello world! {context.world.Name}");
        }
    }
}
  • In your project folder find (ProjectName)-FeatureGraph file, double click it
image9
  • Right click on empty space inside graph window and choose : “Create system”
image3
  • Choose HelloWorldSystem in graph node dropdown:
image2
  • Connect Start and Exit nodes with HelloWorldSystem Node:
image6
  • Click Save Graph and Compile Graph buttons, click play mode.
Clone this wiki locally