Search Unity

Resolved Unity Engine script assemblies not accessible in my package

Discussion in 'Package Manager' started by QuantumCalzone, Dec 6, 2020.

  1. QuantumCalzone

    QuantumCalzone

    Joined:
    Jan 9, 2010
    Posts:
    262
    I have this project; a package I'm developing that's extending Unity's Layout Element component. However, when I build I get errors like below

    Code (CSharp):
    1. Packages\UnityLayoutElementExtended\Editor\Editors\LayoutElementExtendedEditor.cs(2,19): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'UnityEditor' (are you missing an assembly reference?)
    2.  
    3. Packages\UnityLayoutElementExtended\Editor\Editors\LayoutElementExtendedEditor.cs(8,48): error CS0246: The type or namespace name 'LayoutElementEditor' could not be found (are you missing a using directive or an assembly reference?)
    4.  
    5. Packages\UnityLayoutElementExtended\Editor\PropertyDrawers\LayoutElementExtendedValuePropertyDrawer.cs(7,61): error CS0246: The type or namespace name 'PropertyDrawer' could not be found (are you missing a using directive or an assembly reference?)
    I have script assemblies for both sections of my code (Scripts and Editor). I think I've set their references correctly


    The errors above are like I need to set UnityEngine and UnityEditor themselves as references but they do not appear as an option to do so. I'm kind of stumped as to what the problem is.

    I have a feeling I'm missing something really simple or this is a Unity bug. Anyone else have similar issues?

    I'm on Windows Unity 2020.
     
  2. QuantumCalzone

    QuantumCalzone

    Joined:
    Jan 9, 2010
    Posts:
    262
    Ah, so the issue was that my editor Assembly Reference needed to exclude all platforms except the editor. Yay for simple solution!
     
    Nefisto likes this.