Search Unity

EditorOnly tag

Discussion in 'Scripting' started by Deleted User, Aug 2, 2014.

  1. Deleted User

    Deleted User

    Guest

    I have a qustion about the EditorOnly tag, I know its purpose to prevent gameobjects under that tag to be included in the scene on build. What I would like to know if the content of said objects is still allocated.

    I have a script that retain just simple text, I use it as a memo system for editor only usage. I wanted to be sure that when I build the game the serialized text won't be allocated in memory at build time even if the gameobject isn't included in the scene, does EditorOnly tag prevent this too?

    Thanks.
     
  2. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    The EditorOnly flag should mean that any game objects that are flagged with it are not built into the player. So that means that the scripts on those game objects also won't be built. You can verify that by printing out a list of all MonoBehaviours in the scene using GameObject.FindObjectsOfType(typeof(MonoBehaviour)).
     
    NotaNaN, Fr33zerPop and Deleted User like this.
  3. DonLoquacious

    DonLoquacious

    Joined:
    Feb 24, 2013
    Posts:
    1,667
    Man, you're on a necro-frenzy today.
     
    NotaNaN and samizzo like this.
  4. samizzo

    samizzo

    Joined:
    Sep 7, 2011
    Posts:
    487
    Hehe, it just annoys me when there are these posts with no answers or wrong answers for like a year!
     
    abrusleFDJ and NotaNaN like this.
  5. Deleted User

    Deleted User

    Guest

    Well thank you for the reply anyway, necro or not, was still wondering the answer even to this day lol.
     
    NotaNaN likes this.