Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Monobevaiour script is invoked even if there is no object attached.

Discussion in '2D Experimental Preview' started by seobyeongky, Jun 10, 2017.

  1. seobyeongky

    seobyeongky

    Joined:
    Sep 29, 2015
    Posts:
    11
    Script's Awake, OnEnable, OnDisable functions are invoked when I select a prefab containing script and SpriteRenderer at playing the editor.
    The function is called by GUIUtility:: ProcessEvent.

    Bug recurring step:
    1. Create new project
    2. Create a script and add log on Awake.
    3. Create a prefab and attach a SpriteRenderer and the script.
    4. Assign SpriteRenderer's sprite field to any sprite.
    5. Create a empty scene.
    6. Select the prefab and play the editor.
    7. Then you can see the log.

    I attached the project.

    I am using 2D Experimental Preview 4 Updated May 11th 2017.
    I checked Unity 5.6.0f3 version has no problem with this issue.

    Thank you.
     

    Attached Files: