fix worldBuilder being able to set a non-component
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
0a30dab3c2
commit
bdd9f59549
|
@ -82,7 +82,7 @@ namespace Encompass
|
|||
/// <summary>
|
||||
/// Sets Component data for the specified Component Type on the specified Entity.
|
||||
/// </summary>
|
||||
public void SetComponent<TComponent>(Entity entity, in TComponent component) where TComponent : struct
|
||||
public void SetComponent<TComponent>(Entity entity, in TComponent component) where TComponent : struct, IComponent
|
||||
{
|
||||
RegisterComponentType<TComponent>();
|
||||
_startingExistingComponentStore.Set(entity.ID, component);
|
||||
|
@ -95,7 +95,7 @@ namespace Encompass
|
|||
}
|
||||
}
|
||||
|
||||
internal void RegisterComponentType<TComponent>() where TComponent : struct
|
||||
internal void RegisterComponentType<TComponent>() where TComponent : struct, IComponent
|
||||
{
|
||||
if (!_typeToIndex.ContainsKey(typeof(TComponent)))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue