Browse Source

disabling code when not needed

tags/2.7
sebas77 6 years ago
parent
commit
90f2a9952e
2 changed files with 7 additions and 4 deletions
  1. +1
    -1
      Svelto.Common
  2. +6
    -3
      Svelto.ECS/EnginesRoot.Entities.cs

+ 1
- 1
Svelto.Common

@@ -1 +1 @@
Subproject commit caa6a443cb284dfe9e1947dd1552c15614518bbc
Subproject commit 11ed3db70d728ac4067df91f11d0ae7934a9005a

+ 6
- 3
Svelto.ECS/EnginesRoot.Entities.cs View File

@@ -64,7 +64,7 @@ namespace Svelto.ECS
return new EntityStructInitializer(entityID, dic);
}
#if DEBUG && !PROFILER
void CheckEntityID(EGID entityID, IEntityDescriptor descriptorEntity)
{
Dictionary<Type, ITypeSafeDictionary> @group;
@@ -79,14 +79,16 @@ namespace Svelto.ECS
}
}

static void CheckEntityID(EGID entityID, Type entityType, Dictionary<Type, ITypeSafeDictionary> @group, string name)
static void CheckEntityID(EGID entityID, Type entityType, Dictionary<Type, ITypeSafeDictionary> @group,
string name)
{
ITypeSafeDictionary entities;
if (@group.TryGetValue(entityType, out entities))
{
if (entities.Has(entityID.entityID) == true)
{
Svelto.Utilities.Console.LogError("Entity ".FastConcat(name, " with used ID is about to be built: ")
Svelto.Utilities.Console.LogError("Entity ".FastConcat
(name, " with used ID is about to be built: ")
.FastConcat(entityType)
.FastConcat(" id: ")
.FastConcat(entityID.entityID)
@@ -95,6 +97,7 @@ namespace Svelto.ECS
}
}
}
#endif
///--------------------------------------------

void Preallocate<T>(int groupID, int size) where T : IEntityDescriptor, new()


Loading…
Cancel
Save