#Did the latest version of DOTS ECS break the SystemBase added through AddSystemManaged?
1 messages · Page 1 of 1 (latest)
Did the latest version of DOTS ECS break the SystemBase added through AddSystemManaged?
I pasted the following into one of the Entities package test files, and the test passes.
[DisableAutoCreation]
public partial class RenderingDOTSPositionSyncEngine:SystemBase
{
protected override void OnUpdate()
{
throw new InvalidOperationException("I ran!");
}
}
[Test]
public void AddSystemManaged_WithDisableAutoCreation_Works()
{
var sysInstance = new RenderingDOTSPositionSyncEngine();
var sys = World.AddSystemManaged(sysInstance);
Assert.That(() => sys.Update(), Throws.InvalidOperationException.With.Message.Contain("I ran!") );
}
Is there any further context that could be contributing to this error? What's the specific error you're seeing?
@spare nebula suggests adding this check to AddSystemManaged(), which would guard against the case where an unregistered system type is somehow provided. The same check is already present in CreateSystemManaged().
if (idx == SystemTypeIndex.Null)
{
TypeManager.AddSystemTypeToTablesAfterInit(typeof(T));
idx = TypeManager.GetSystemTypeIndex<T>();
}
...but we're still not sure why the system wouldn't be registered in the first place.
Anyway, we'll push the fix to the next Entities release. Thanks for the report!