public unsafe void LogEntityInfo(Entity entity) { Archetype *archetypePtr = ref this.m_Manager.Entities.GetArchetype(entity); Unity.Debug.Log($"Entity {entity.Index}.{entity.Version}"); for (int i = 0; i < archetypePtr->TypesCount; i++) { ComponentTypeInArchetype archetype = archetypePtr->Types[i]; Unity.Debug.Log($" - {archetype.ToString()}"); } }
internal static unsafe string GetArchetypeDebugString(Archetype *a) { StringBuilder builder = new StringBuilder(); builder.Append("("); int index = 0; while (true) { if (index >= a.TypesCount) { builder.Append(")"); return(builder.ToString()); } ComponentTypeInArchetype archetype = a.Types[index]; if (index > 0) { builder.Append(", "); } builder.Append(archetype.ToString()); index++; } }