This is my code from MonoBehavior
{
id = idCounter++; // idCounter is basically a static
units.Add(id, this); // units is dictionary datastructure
// from here I want to reference to a entity somehow be it be through Entities.Add() or Get an Entity from pooling
// after that call OnSpawnEvent
OnSpawnedEvent?.Invoke(this);
}
private void OnDisable()
{
// On death we will call OnDeath event who are subscribed to it
OnDeathEvent?.Invoke(this);
units.Remove(id);
// Also we will remove links to Entities here. If possible make them go back to Object Pool as a deactivated component or something
}
I want to slowly transition to DOTS. For that I just dont want to do a total rewrite and rather slowly transition into DOTS. From the code I want MonoBehavior somehow linked to Entities to interact with ECS codes. From ECS I want to interact with MonoBehavior stuffs as well. What to do in this case?