Hello! For some reason, the Bake() function for my only authoring script refuses to be called, despite the authoring script being attached to a single empty object in an empty Scene. It is supposed to bake a singleton entity storing configuration values.
I have tried setting the GameObject as Authoring/Mixed/Runtime. I have also tried adding the authoring script to an empty object within a new sub-scene. I cannot get the entity to bake. Any ideas what could be causing the issue?
The weird thing is that this authoring code used to bake. But I accidentally broke the subscene I had setup by deleting some assets. When I tried recreating the subscene, it refuses to bake. I have tried restarting Unity several times.
Here is the authoring code:
public class ConfigAuthoring : MonoBehaviour
{
public GameObject unitPrefab;
class Baker : Baker<ConfigAuthoring>
{
public override void Bake(ConfigAuthoring authoring)
{
var entity = GetEntity(TransformUsageFlags.None);
AddComponent(entity, new Config
{
// Add Config values when I think I need them for debugging
UnitPrefab = GetEntity(authoring.unitPrefab, TransformUsageFlags.Dynamic),
});
Debug.Log("Baked Config entity");
}
}
}
public struct Config : IComponentData
{
public Entity UnitPrefab;
}