Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

What the use of the AssemblyIsEditorAssembly?

Discussion in 'Editor & General Support' started by watsonsong, May 28, 2019.

  1. watsonsong

    watsonsong

    Joined:
    May 13, 2015
    Posts:
    555
    I check my asmdef assembly with the following code:

    var t = typeof(MyEditorClass);
    Debug.Log(t.Assembly.FullName);
    Debug.Log(t.Assembly.IsDefined(typeof(AssemblyIsEditorAssembly), false));


    But the last log always false.
    How can I detect whether a class is define in editor assembly, and how is the correctly way to use the UnityEngine.AssemblyIsEditorAssembly attribute?