The entity spawning feature has been adapted to conform to the ISharedWriteAccessControlledValue interface. This makes for easy inclusion in TaskDriver jobs that require entity spawning.
What is the current behaviour?
In a TaskDriver, to gain access to an EntitySpawnWriter the developer must manually acquire and pass the writer into their job through a custom the scheduling delegate. This is painful.
What is the new behaviour?
Developers can now include EntitySpawnWriters in their TaskDriver jobs with a convenient RequireGenericDataForWrite(EntitySpawner) call.
As part of this work EntitySpawner is now a public type. Since developers may hold reference to the spawner rather than calling GetSpawner<T> every frame the mechanism for marking a spawner for update needed to be updated. EntitySpawner now emits an event indicating that it has pending work to schedule instead of having EntitySpawnSystem track that dirty state.
What issues does this resolve?
What PRs does this depend on?
216
Does this introduce a breaking change?
[x] Yes
[ ] No
Migration
EntitySpawnSystem.AcquireEntitySpawnWriterAsync<DefinitionType>(out var value) -> EntitySpawnSystem.GetSpawner<DefinitionType>.AcquireSharedWriteAsync(out var value)
The entity spawning feature has been adapted to conform to the
ISharedWriteAccessControlledValue
interface. This makes for easy inclusion in TaskDriver jobs that require entity spawning.What is the current behaviour?
In a
TaskDriver
, to gain access to anEntitySpawnWriter
the developer must manually acquire and pass the writer into their job through a custom the scheduling delegate. This is painful.What is the new behaviour?
Developers can now include
EntitySpawnWriter
s in theirTaskDriver
jobs with a convenientRequireGenericDataForWrite(EntitySpawner)
call.As part of this work
EntitySpawner
is now a public type. Since developers may hold reference to the spawner rather than callingGetSpawner<T>
every frame the mechanism for marking a spawner for update needed to be updated.EntitySpawner
now emits an event indicating that it has pending work to schedule instead of having EntitySpawnSystem track that dirty state.What issues does this resolve?
What PRs does this depend on?
216
Does this introduce a breaking change?
Migration
EntitySpawnSystem.AcquireEntitySpawnWriterAsync<DefinitionType>(out var value)
->EntitySpawnSystem.GetSpawner<DefinitionType>.AcquireSharedWriteAsync(out var value)
EntitySpawnSystem.ReleaseEntitySpawnWriterAsync(JobHandle)
->EntitySpawnSystem.GetSpawner<DefinitionType>.ReleaseAsync(JobHandle)