Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Exception & log message & debugging improvements

Discussion in 'Entity Component System' started by 5argon, Jun 22, 2018.

  1. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    1. Entity.ToString prints the class name -> better to print (Index : 1 Version : 1) for example.

    2. ArgumentException: The entity does not exist -> ArgumentException: The entity {entity.ToString()} does not exist. use the ToString above.

    3. EntityCommandBuffer : Add a debug mode option to remember the stack trace point of calling commands (like ecb.CreateEntity()) on editor so when the command playback and something goes wrong we know where it really is from. (Turn this on or off only when debugging and do not care about performance)

    4. When using an unallocated native containers (mistakenly using empty constructor instead of Allocator constructor) :

    NullReferenceException: Object reference not set to an instance of an object
    Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle.CheckWriteAndThrow (Unity.Collections.LowLevel.Unsafe.AtomicSafetyHandle handle) (at /Users/builduser/buildslave/unity/build/Runtime/Export/AtomicSafetyHandle.bindings.cs:152)
    Unity.Collections.NativeHashMap`2[TKey,TValue].TryAdd (TKey key, TValue item) (at /Users/Sargon/Library/Unity/cache/packages/staging-packages.unity.com/com.unity.collections@0.0.9-preview.1/Unity.Collections/NativeHashMap.cs:589)

    -> Better to check IsCreated and throw something more descriptive.

    5. Entity Debugger : Make it possible to see backing fields of auto properties in IComponentData shown on Inspector while clicking on the entity because those data is technically stored in IComponentData and is fully usable.

    6. Entity Debugger : Make it possible to see .ToString of custom blittable data type we have in IComponentData. For example currently we all use this fake blittable bool named Bool. It shows up as "Bool" and not "true" or "false" I have written .ToString override for it.

    7. Entity Debugger : Add some indentation because tree structure drop down without indent level is confusing.
     
    ChrisPie and FROS7 like this.