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 sort of of optimizations does unity make to editor-only scripts/functions

Discussion in 'Scripting' started by EternalClickbait, Aug 1, 2020.

  1. EternalClickbait

    EternalClickbait

    Joined:
    May 5, 2019
    Posts:
    22
    I'm wondering what sort of optimizations the Unity Engine makes when build for the editor vs building standalone. I know that scripts in a subfolder called '/Editor/' will not be compiled, but what about event functions such as
    Reset()
    ,
    OnValidate()
    and the like, ones which are only called/required for edit mode. Does Unity just remove the bodies, like a
    Conditional
    Attribute, or does it remove the entire method.