-
Notifications
You must be signed in to change notification settings - Fork 13
Getting started
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 menu.
Choose Add package from git URL option.
Paste git url into this line and click install.
- 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”.
- Create your project
Right click in your project tab Create > ME.BECS > Create Project
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.
- 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
- Right click on empty space inside graph window and choose : “Create system”
- Choose HelloWorldSystem in graph node dropdown:
- Connect Start and Exit nodes with HelloWorldSystem Node:
- Click Save Graph and Compile Graph buttons, click play mode.