Search Issue Tracker
Won't Fix
Won't Fix in 1.0.X
Votes
2
Found in [Package]
1.0.X - Entities
Issue ID
ECSB-549
Regression
No
InvalidOperationException is thrown when the method WithNone<> is used with a struct that implements IEnableableComponent
How to reproduce:
1. Open the “Entities.zip“ project
2. Enter the “SampleScene“
3. Enter Play Mode and observe the Console
Expected result: No errors are seen
Actual result: InvalidOperationException error is seen
Reproducible with: 1.0.8, 1.0.11 (2022.3.5f1)
Reproducible on: Windows 10
Error:
InvalidOperationException: The previously scheduled job TestSystem1:TestJob writes to the ComponentTypeHandle<TestComponent2> TestJob.JobData.__TypeHandle.__TestComponent2_RW_ComponentTypeHandle. You are trying to schedule a new job TestSystem2:TestJob, which reads from the same ComponentTypeHandle<TestComponent2> (via TestJob.safety). To guarantee safety, you must include TestSystem1:TestJob as a dependency of the newly scheduled job.
Comments (1)
-
Ammar_Negm
Jul 18, 2023 11:12
pls fix
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Remove Unused Overrides” available on not loaded Scene and throws “ArgumentException: The scene is not loaded” warning
- Adaptive Probe Volume occlusion edge is calculated incorrectly when viewing probes near geometry edges
- Sampling a texture using an HLSL file throws shader errors and the code does not compile
- "Graphics.CopyTexture called with null source texture" error when Base Camera of an Overlay Camera is removed with DX11 Graphics API and Compatibility Mode enabled
- WebGL sends wrong value with large numbers when SendMessage function is used
Resolution Note:
There are no fixes planned for this Bug
Resolution Note (1.0.X):
After some further investigation, I don't think we can fix this in Entities 1.x without breaking API changes. At the point where WithNone<T> is specified and system type dependencies are added, we simply can't tell whether the user's intent is that the type is missing (in which case, no type dependency should be added) or disabled (in which case, a read or read/write dependency is necessary). I've filed a ticket to revisit EntityQuery type categories to avoid this ambiguity.
The workaround in the meantime is to prefer the WithAbsent<T> or WithDisabled<T> alternatives to WithNone<T>, which let you more explicitly declare a query's expectations around an excluded component type. Specifically, if a system will be re-enabling disabled types in a job; it should use WithDisabled<T> instead of WithNone<T>. It seems uncommon that a query would genuinely not care whether a type was absent or disabled, but in that case (if the type is actually not accessed at all) then WithNone<T> would be appropriate.