I understand the basic core of DOTS, like jobs, systems, and I can write most of the logic I want. But as the title says I struggle when it comes to doing anything visual. All the samples show is how to spawn a prefab, then move, and eventually remove it. Here’s a shortlist of problems I’ve encountered:
How to handle text? Is TMP compatible with DOTS? Any examples of how to use it?
I see that the animation package didn’t change in the last 6 months, is there any ETA for the next version, or an alternative?
What is the best approach to “hybrid components”? It seems that Unity decides to turn its attention to convert and subscene workflows. For me, it seems that’s a good way to convert your prefabs to entities, but I have no clue how to have calculations in ECS and then update MonoBehaviour with calculated values. Calling EntityManager.GetComponent in i.e. LateUpdate seems inefficient.
No UI solution is compatible with DOTS currently, you need to use normal GameObject for that for create a custom solution
An alternative is to use GameObject for the animations or create a custom solution
HybridComponents can (and should) be accessed from the systems, you can use Entities.ForEach(SomeHybridComponent myHybrid, AnotherHybrid, anotherHybrid, ref SomeComponentData someData…
Just remember that HybridComponents are like class based ComponentData and ComponentObjects (no ref or in keyword, and they should come first)
Thanks! HybridComponents works like a charm. Is there an easy way to have a child object with all non-DOTS stuff and on conversion detach it from the main object? When I use the StopConvertToEntity component all my HybridComponents lose references to the game objects.
You need to maintain that reference yourself currently, this is one of the well-known gaps in the current conversion workflow…
One way here is to create a conversion system that runs before all others that picks everything with StopConvertToEntity and add a class-based componentdata that holds a GameObject reference, that should work.
one way of communicating with monobehaviour is to Add it as a ComponentObject to the entity and use it within systems with Entities.Foreach withoutBurst and Run, the benefit of this approach is that you can handle the time of the execution very presicely which allow you to solve synchronization issues but also wasting execution time on an unwanted Job.Complete