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.
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
- Standard Unity Materials and Shaders become corrupted after importing specific Asset Packages
- [Linux][OpenGL][Vulkan] Draw calls are not shown in the Event List when taking a capture of a frame with RenderDoc
- Inaccurate collision detections when Rigidbody Collision Detection is set to "Continuous" or "Continuous Dynamic"
- Crash on Object::IncrementPersistentDirtyIndex when upgrading project version
- [iOS] Multiple Xcode project instances created before opens up when performing Build and Run for iOS Platform
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.