Unity DOTS(ECS)中的 'FixedUpdate' 在哪里?

Where is 'FixedUpdate' in Unity DOTS (ECS)?

我开始找到使用 DOTS(面向数据的技术堆栈)制作对象的方法。

到处都有几个示例,Youtube 视频以及直接来自 Unity 的示例,例如 github 存储库 'EntityComponentSystemSamples'。

在所有这些中,我偶然发现了 'OnUpdate',但从未 'OnFixedUpdate'。

通常情况下,Unity GameObjects 会有两个,一个用于每个图形帧更新 (OnUpdate),一个用于每个物理运动更新 (OnFixedUpdate)。

尝试创建使用 Rigidbody.AddForce() 的行为时,使用 FixedUpdate() 始终很重要。

这个概念在 DOTS 中被删除了吗?如何在 DOTS 中向 PhysicsBody 添加脚本化的、变化的力?

目前,我正在将我的 force*deltatime 添加到更新中的 Unity.Physics.PhysicsVelocity

每个系统只能属于一个系统组。你用属性指定它。

属性 [UpdateInGroup(typeof(SimulationSystemGroup))] 使您的 OnUpdate 被称为一般 game/simulation 更新。这是系统的默认组。

属性 [UpdateInGroup(typeof(FixedStepSimulationSystemGroup))] 使您的 OnUpdate 在固定模拟间隔内被调用(即:FixedUpdate)。

Note: This^ correction is taken from @thelebaron answer. Give him an upvote please.

属性 [UpdateInGroup(typeof(PresentationSystemGroup))] 使您的 OnUpdate 在渲染上下文中被调用;在绘制帧之前(即:更新


[UpdateInGroup( typeof(SimulationSystemGroup) )]
public class SomeKindOfSimulationSystem : SystemBase
{
    protected override void OnUpdate ()
    {
        /* simulation update */
    }
}
[UpdateInGroup( typeof(PresentationSystemGroup) )]
public class SomeKindOfRenderingSystem : SystemBase
{
    protected override void OnUpdate ()
    {
        /* rendering update */
    }
}

由于代表的原因,我无法添加评论,但为了跟进 Andrew Lukasik 的回答,现在有一个 FixedStepSimulationSystemGroup,您可以在其中更新您的系统(这是物理系统在其中更新的地方)。