Search Unity

Assembly Definition files for editor-only example classes

Discussion in 'Scripting' started by nandos13, Feb 16, 2018.

  1. nandos13

    nandos13

    Joined:
    Jun 19, 2017
    Posts:
    2
    I am working on a framework repository which features example classes which describe how to use certain systems. The folder structure looks like the following:
    Framework Folder / Feature Folder / Examples Folder

    Separating these example scripts out into a separate assembly definition file is not required, but I'd like to do so. Creating a new Assembly Definition in the Examples folder and setting it to only include Editor seems to have the same effect as putting the whole folder inside an Editor folder, that is, the contained scripts become "editor scripts" and are not able to be attached to GameObjects.

    Is this intended behaviour? I understand that the idea of editor-only scripts in a scene does not make sense, and issues would arise if a scene was built with a script which is later stripped from the build. I still feel it would be nice to separate certain MonoBehaviour scripts into an Editor only assembly