Search Unity

GenerateAuthoringComponent Namespace?

Discussion in 'Entity Component System' started by Shabbalaka, Jan 19, 2020.

  1. Shabbalaka

    Shabbalaka

    Joined:
    Jan 15, 2018
    Posts:
    154
    Noob question:
    Why is this code complaining I,m missing a Namespace or Directive ?

    Code (CSharp):
    1.  using Unity.Entities;
    2. [GenerateAuthoringComponent]
    3.  
    4. public struct PrefabEntityComponent : IComponentData {
    5.      public Entity prefabGameobject;
    6. }
    What package do i need to install or Using statemen please?

    PS I accidentally posted this in Scripting also, Will try to remove it.
     
  2. BackgroundMover

    BackgroundMover

    Joined:
    May 9, 2015
    Posts:
    224
    Is the code inside an AssemblyDefinition that doesn't have Unity.Entities listed in its references? Did you just install the Entities package but haven't restarted the editor yet?
     
  3. Shabbalaka

    Shabbalaka

    Joined:
    Jan 15, 2018
    Posts:
    154
    Ahh i didnt restart the editor will try that !

    Restarted the editor and VS:Code still reports a missing Namespace/Directive : (

    I was watching a CodeMonkey tutorial and he types the exact same thing but gets no error,s but he doesnt say what Packages he,s using in the tutorial (The newest video about converting Prefabs to Entities)
     
    Last edited: Jan 19, 2020
  4. Shabbalaka

    Shabbalaka

    Joined:
    Jan 15, 2018
    Posts:
    154
    It turns out that I needed to update the Editor to 2019.3 and use Entities 0.5
     
    kakablank likes this.