Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

ECS Intellisense not working (Visual Studio)

Discussion in 'Entity Component System' started by TheGameNewBie, Dec 2, 2020.

  1. TheGameNewBie

    TheGameNewBie

    Joined:
    Jul 27, 2017
    Posts:
    92
    I recently installed the Entities package. I was just getting started, writing a simple system to move a cube.
    But I'm having problems with Visual Studio Intellisense. It does not seem to work with Entities. It always gives me errors on what seems to be the right syntax.
    ECS Intellisense.PNG Unity Compiler also gives the following error,
    ECS Error.PNG
    But I do have '.Run()' ? I tried regenerating .csproj files, no luck.

    I'm using,
    Unity 2020.1.2f1
    Visual Studio 2015
    Visual Studio Editor Package 2.0.5
     
  2. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
    That's a Job Error .Not a c# compiler error.
    Job system does not allow reference type, in your case
    Time
    , in job code.
    you need to make it a local variable.
    float dt=Time.DeltaTIme
    ; outside of the job and use dt in the job.
     
  3. TheGameNewBie

    TheGameNewBie

    Joined:
    Jul 27, 2017
    Posts:
    92
    I tried that and it does compile. But the IDE is still giving me errors.
    ECS Intellisense 2.PNG
    ECS Intellisense 3.PNG
    ECS Intellisense 4.PNG

    ECS Intellisense 5.PNG
    The code works fine. But Intellisense is not working.
     
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,541
    I believe Time delta time is not part System Base OnUpdate. It maybe a part of MonoBehaviour Update.

    Myself I wouldn't be using delta time in systems anyway.
     
  5. Lieene-Guo

    Lieene-Guo

    Joined:
    Aug 20, 2013
    Posts:
    547
  6. TheGameNewBie

    TheGameNewBie

    Joined:
    Jul 27, 2017
    Posts:
    92
    But it works? Unity does not give any errors. I can also play the game. It's Visual Studio giving me errors.
    What about the other two?
    'in' keyword and '.' at the end of the foreach statement?

    Unfortunately, it doesn't work.
     
  7. PublicEnumE

    PublicEnumE

    Joined:
    Feb 3, 2019
    Posts:
    729
    It’s been a while since I used Entities.ForEach, but I believe intellisense struggles to work inside of those lambda functions. It was a limitation that Unity knew about, and hoped to address at some point. Back then, Entities.ForEach was still pretty new, and there were higher priority issues that needed their focus.

    At least, I believe what you’re attempting to do would not work at all with intellisense and ECS as of a few versions (months) ago.

    Does anyone know if this has changed in one of the newer ECS packages?
     
  8. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,541
    In a first case s enario, is InputData IComponentData by any chance?
    float3 works for me, but I would need check other cases you presented, if does work with lambda on my Unity.