Post Jam: An empty EntityQuery in OnCreate() disables your system
OK so interesting result of initialising an `EntityQuery` in a system's `OnCreate()` is that it's considered by `ShouldRunSystem()`. If the query doesn't result in any contents, the System will not be started! (`OnStartRunning()` and `OnUpdate()` won't get called.)
Tried moving the `EntityQuery` creation to `OnStartRunning()` and the system starts then immediately disables when it got 0 results!
Ahha, instead of creating the query with the `JobComponentSystem`-based `GetEntityQuery()`, use `EntityManager.CreateEntityQuery()` and it's not considered as part of the system's requirements! Interesting.
Still running into the joint-already-present problem. Could I be suffering from doing it in a single frame and I need a within-frame check of those already requested? Yep. Added those created in this frame to a `NativeList<Entity>` and checked that as well and voila! It's works!
I might take this a little further to something what I'd hoped the entry to be -- something like a spider spewing tangly webs and dragging stuff about.
Let me know if you think it's worth it :)
Connect the Unity (ECS) DOTS (for ExtraCredits Jam 2019)
An Extra Credits Jam 2019 entry focusing on learning Unity DOTS
Status | Prototype |
Author | Arakade |
Tags | 3D, connecttheunitydots, extragamejam, Unity |
More posts
- Final physics OnCollision flowJun 12, 2019
- ECS & Unity.Physics order diagramJun 08, 2019
- ECS Unity.Physics: Contacts, The Right Way (full OnCollisionEnter(Collision) ana...Jun 06, 2019
- Post-jam next stepsJun 05, 2019
- Monday night: Joint add or setJun 04, 2019
- Sunday afternoonJun 04, 2019
- Saturday night: Implementing DOTS Unity.Physics OnCollisionEnter() only for cert...Jun 02, 2019
- Saturday afternoon Unity.Physics and DOTS samples strife (after late start)Jun 01, 2019
- Friday nightJun 01, 2019
Leave a comment
Log in with itch.io to leave a comment.