Search Unity

Namespace UnityEditor?

Discussion in 'Linux' started by Fra123X, Sep 9, 2015.

  1. Fra123X

    Fra123X

    Joined:
    Mar 10, 2013
    Posts:
    40
    Now I don't know if I am missing anything, but after compiling a game I got the error
    Code (Error):
    1. "The type or namespace name `UnityEditor' could not be found. Are you missing a using directive or an assembly reference?"
     
  2. LaneFox

    LaneFox

    Joined:
    Jun 29, 2011
    Posts:
    7,519
    Compiler strips UnityEditor.

    Use...

    Code (csharp):
    1.  
    2. #if UNITY_EDITOR
    3. using UnityEditor;
    4. #endif
    5.  
    6. ...
    7.  
    Also need to do that for any editor code inside your runtime scripts.
     
    Fra123X likes this.
  3. Fra123X

    Fra123X

    Joined:
    Mar 10, 2013
    Posts:
    40
    Thanks for that, seems to be working fine :)
     
    LaneFox likes this.