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

884 Views Asked by At
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();
     }
 }

I know I haven't entered parameters yet for Entities.ForEach(); — that’s not my issue. I get the error message;

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

Am I doing something wrong here?

1

There are 1 best solutions below

0
On BEST ANSWER

I figured it out. I extended JobComponentSystem and used Unity's job system instead of what appears to be a deprecated Entities.ForEach() method. And then I tried using Unity 2019.3 (was using 2018.4 before), and it all fell apart. Got tons of error messages and apparently JobComponentSystem is now deprecated too? So I've now decided I'm going to wait for the DOTS team to finish this thing up, because I'm working on a big project, and this lack of documentation combined with a constantly changing library is making my head hurt.

TL;DR: No one will ever read this again because Unity DOTS will be unrecognizable pretty soon and these kinds of problems will probably not exist.