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

A way to know if unity was just opened? [ExecuteInEditMode]

Discussion in 'Editor & General Support' started by Mutimir, Jan 29, 2019.

  1. Mutimir

    Mutimir

    Joined:
    Dec 6, 2018
    Posts:
    36
    I have some [ExecuteInEditMode] scripts that executes when a specific object is added to the scene. The Init() function which is called in OnEnable() should be called when the object is created and after exiting play mode which it does. But for some reason it is called multiple times when i open Unity. Is there a way to know if unity was just opened?
     
  2. Mutimir

    Mutimir

    Joined:
    Dec 6, 2018
    Posts:
    36
    I guess i should have placed this in the answers tab, sorry.
     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,350