mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Update EntitySystem.cs
This commit is contained in:
@@ -47,7 +47,7 @@ namespace TEngine.EntityModule
|
|||||||
|
|
||||||
internal void RemoveEntity(Entity entity)
|
internal void RemoveEntity(Entity entity)
|
||||||
{
|
{
|
||||||
Entities.Remove(entity);
|
Entities.Buckets[entity.Index] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private T Get<T>() where T : EcsObject, new()
|
private T Get<T>() where T : EcsObject, new()
|
||||||
@@ -135,6 +135,42 @@ namespace TEngine.EntityModule
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void FixedUpdate()
|
||||||
|
{
|
||||||
|
int count = Entities.Count;
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
if (!Entities.Buckets[i])
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Entities[i].CanFixedUpdate)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Entities[i].FixedUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LateUpdate()
|
||||||
|
{
|
||||||
|
int count = Entities.Count;
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
if (!Entities.Buckets[i])
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Entities[i].CanLateUpdates)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Entities[i].LateUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Dispose
|
#region Dispose
|
||||||
|
Reference in New Issue
Block a user