当前上下文中不存在名称 'Entities'

The name 'Entities' does not exist in the current context

using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 using Unity.Entities;
   
 public class AttributesGenerationSystem : ComponentSystem
 {
     private static EntityManager entityManager;
   
     [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
     public static void Initialize()
     {
         entityManager = World.Active.GetOrCreateManager<EntityManager>();
     }
     protected override void OnUpdate()
     {
         Entities.ForEach();
     }
 }

我知道我还没有为 Entities.ForEach() 输入参数; ——那不是我的问题。我收到错误消息;

“名称 'Entities' 在当前上下文中不存在”

我是不是做错了什么?

我明白了。我扩展了 JobComponentSystem 并使用了 Unity 的作业系统,而不是似乎已弃用的 Entities.ForEach() 方法。然后我尝试使用 Unity 2019.3(之前使用的是 2018.4),但一切都崩溃了。收到大量错误消息,显然 JobComponentSystem 现在也已弃用?所以我现在决定等待 DOTS 团队完成这件事,因为我正在做一个大项目,缺乏文档加上不断变化的库让我很头疼。

TL;DR:没有人会再读一遍这篇文章,因为 Unity DOTS 很快就会变得面目全非,这类问题可能不会存在。