Hi, I’ve created this unit test to make sure I understand the ISystemStateComponentData component.
[Test]
public void SystemStateComponentExistsAfterDestroyEntity() {
var e = _entityManager.CreateEntity();
_entityManager.AddComponent<TestComponentData>(e);
_entityManager.AddComponent<TestSystemStateComponentData>(e);
// We have two components.
Assert.That(_entityManager.GetComponentCount(e), Is.EqualTo(2));
// After destroying the entity we only have the system state component left.
_entityManager.DestroyEntity(e);
Assert.That(_entityManager.HasComponent<TestComponentData>(e), Is.False);
Assert.That(_entityManager.HasComponent<TestSystemStateComponentData>(e), Is.True);
assertion fails, GetComponentCount() returns 2???
Assert.That(_entityManager.GetComponentCount(e), Is.EqualTo(1));
// Removing the system state component removes the entity.
_entityManager.RemoveComponent<TestSystemStateComponentData>(e);
Assert.That(_entityManager.Exists(e), Is.False);
}
Why is GetComponentCount() returning 2, but the HasComponent(e) returns false? This seems like a bug with GetComponentCount() to me?