i want to bake an entire subfolder of assets into a dynamicbuffer of baked prefab entities
this "works":
class MySO : ScriptableObject { public GameObject prefab; }
struct R : IBufferElementData { public Entity prefab; }
class MyAuthoring : MonoBehaviour {
class Baker : Baker<MyAuthoring> {
public override void Bake(MyAuthoring a) {
var buf = AddBuffer<R>(GetEntity(a));
foreach(var r in Resources.LoadAll<MySO>("MySOs")) {
buf.Add(new R{ prefab = GetEntity(r.prefab) });
...but it doesn't update when new assets are created; i wasn't able to find anything relevant to this in struct BakeDependencies
i can add a dummy variable to MyAuthoring that triggers rebaking but of course that requires manually incrementing it whenever something changes
is there a "blessed" way to achieve this?
if not i'm thinking of creating an editor tool that runs automatically on asset database updates, computes a hash of asset paths, and updates it into the authoring component in all subscenes containing that component, but that's a lot of work...