mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
Update EntitySystem.cs
This commit is contained in:
@@ -47,7 +47,7 @@ namespace TEngine.EntityModule
|
||||
|
||||
internal void RemoveEntity(Entity entity)
|
||||
{
|
||||
Entities.Remove(entity);
|
||||
Entities.Buckets[entity.Index] = false;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
#region Dispose
|
||||
|
Reference in New Issue
Block a user