diff --git a/Assets/TEngine/Runtime/Entity/Entity.cs b/Assets/TEngine/Runtime/Entity/Entity.cs index 454727c5..7cdf728c 100644 --- a/Assets/TEngine/Runtime/Entity/Entity.cs +++ b/Assets/TEngine/Runtime/Entity/Entity.cs @@ -52,8 +52,7 @@ namespace TEngine.EntityModule internal List LateUpdates = new List(); internal bool InActive; internal bool CanUpdate; - internal bool CanFixedUpdate; - internal bool CanLateUpdate; + public int Index { get; set; } = -1; public Entity() { diff --git a/Assets/TEngine/Runtime/Entity/EntityExt.cs b/Assets/TEngine/Runtime/Entity/EntityExt.cs index df84b45d..3fee1aa0 100644 --- a/Assets/TEngine/Runtime/Entity/EntityExt.cs +++ b/Assets/TEngine/Runtime/Entity/EntityExt.cs @@ -18,8 +18,6 @@ namespace TEngine.EntityModule CanUpdate = Updates.Count > 0; - CanFixedUpdate = FixedUpdates.Count > 0; - Destroy(component); } @@ -39,7 +37,7 @@ namespace TEngine.EntityModule FixedUpdates.Add(fixedUpdate); } CanUpdate = Updates.Count > 0; - CanFixedUpdate = FixedUpdates.Count > 0; + return component; } @@ -58,7 +56,6 @@ namespace TEngine.EntityModule FixedUpdates.Add(fixedUpdate); } CanUpdate = Updates.Count > 0; - CanFixedUpdate = FixedUpdates.Count > 0; return component; } diff --git a/Assets/TEngine/Runtime/Entity/EntitySystem.cs b/Assets/TEngine/Runtime/Entity/EntitySystem.cs index 789496b2..0f333610 100644 --- a/Assets/TEngine/Runtime/Entity/EntitySystem.cs +++ b/Assets/TEngine/Runtime/Entity/EntitySystem.cs @@ -132,47 +132,6 @@ namespace TEngine.EntityModule }); } } - - /// - /// 更新Entity物理系统 - /// - /// 线程池是否并行 - public void FixedUpdate(bool worker = false) - { - int count = Entities.Count; - if (!worker) - { - for (int i = 0; i < count; i++) - { - if (!Entities.Buckets[i]) - { - continue; - } - - if (!Entities[i].CanFixedUpdate) - { - continue; - } - Entities[i].FixedUpdate(); - } - } - else - { - Parallel.For(0, count, i => - { - if (!Entities.Buckets[i]) - { - return; - } - - if (!Entities[i].CanFixedUpdate) - { - return; - } - Entities[i].FixedUpdate(); - }); - } - } #endregion #region Dispose