I have a gameobject in the ECS scene with the following script:
using Unity.Collections;
using Unity.Entities;
using UnityEngine;
namespace CellEngine.World
{
public class CellProviderAuthoring : MonoBehaviour
{
[SerializeField] private CellAuthoring[] _cells;
public class CellProviderBaker : Baker<CellProviderAuthoring>
{
public override void Bake(CellProviderAuthoring authoring)
{
Entity entity = GetEntityWithoutDependency();
NativeArray<CellPrefab> prefabs = new (authoring._cells.Length, Allocator.Persistent);
for (int i = authoring._cells.Length; i --> 0;) {
CellAuthoring cellAuthoring = authoring._cells[i];
Entity prefab = GetEntity(cellAuthoring.gameObject, TransformUsageFlags.None);
CellType type = cellAuthoring.cellType;
prefabs[i] = new CellPrefab(prefab, type);
}
AddComponent(entity, new CellProvider(prefabs));
}
}
}
}
However, when starting the game, it does not appear to have created an entity with the CellProvider component