decline-cookies / anvil-unity-dots

Unity DOTS and ECS specific additions and extensions to Anvil
MIT License
4 stars 1 forks source link

Add Burst compatible debug information for World Unique IDs #244

Open jkeon opened 1 year ago

jkeon commented 1 year ago

TaskDrivers, TaskDriverSystems and associated data like PeristentData and DataStreams all have WorldUniqueIDs now to identify them.

These id's are pretty unreadable as they are hash's of paths.

Ex. NavigateTaskDriver/FollowPathTaskDriver/ActorMoveTaskDriver::ActorMoveActiveDataStream == -7894822749

We have all the information for the path when the ID is generated so let's store that in a FixedString and then store that in an UnsafeParallelHashMap with the key being the WorldUniqueID and the FixedString as the value.

Finally store that in a SharedStatic so that any job or main thread code can access at anytime for a read only debug check.

The specific WorldUniqueID's can have extension methods on their ToString and/or ToFixedString that can do the lookup and swapperoo for us.