Hi! I'm experimenting with ECS and I'm trying to create and spin up a BaseSystem
So I've created a class:
using Unity.Entities;
using UnityEngine;
namespace Systems
{
public struct ForwardInput: IComponentData
{
public bool Value;
}
public partial class GetPlayerInputSystem : SystemBase
{
protected override void OnCreate()
{
Debug.Log("Hello there");
EntityManager.AddComponent<ForwardInput>(SystemHandle);
}
protected override void OnUpdate()
{
var currentInput = new ForwardInput
{
Value = Input.GetKey(KeyCode.W)
};
EntityManager.SetComponentData(SystemHandle, currentInput);
}
}
}
I can see the HEllo there output in the console, but then when going into the entities hierarchy and click on my system, it doesn't appear in the inspector.
Also I can see in the Systems that there is no entity in the System. I'm expecting EntityManager.AddComponent<ForwardInput>(SystemHandle) to add one?
Did I miss anything?