コード例 #1
0
            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()}");
                }
            }
コード例 #2
0
            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++;
                }
            }