Search Unity

Reselect prefab when editor play mode exits?

Discussion in 'Prefabs' started by Botaurus, Jan 21, 2020.

  1. Botaurus

    Botaurus

    Joined:
    Feb 20, 2013
    Posts:
    81
    I spend 80% of my time in Unity editing a prefab in the prefab editor and pressing 'play' to view it in action. When I press play, the prefab is deselected and I have to double click it again to enter the editor when play mode exits. Would be nice if the editor remembered that I was in a prefab editor window.
    If there is a solution to this issue, let me know,
    thanks!
     
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    The editor shouldn't exit Prefab Mode when going in Play Mode except if a script on the Prefab has an ExecuteInEditMode attribute, and in that case you would get a dialog.

    But you also say "select" and "deselect" which is different from entering/exiting Prefab Mode. This makes me unsure of what you mean. Could you post a video showing what you're talking about?
     
  3. Botaurus

    Botaurus

    Joined:
    Feb 20, 2013
    Posts:
    81
    thanks for the help! I'm on Unity 2018 (maybe this is different in 2019?)
    in the gif below, you can see I'm in a prefab view. Then when I press play/stop, I am no longer in a prefab and I need to re-enter the prefab view.
    prefabWorkflow.gif
     
  4. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    What is the exact version of 2018 you're using? Does it still happen in Unity 2018.4.15? If so, can you please file a bug report, so we can investigate. Thanks!
     
  5. Botaurus

    Botaurus

    Joined:
    Feb 20, 2013
    Posts:
    81
    2018.4.12f1. We will try to upgrade and see if that fixes the issue,
    thank you
     
  6. Botaurus

    Botaurus

    Joined:
    Feb 20, 2013
    Posts:
    81
    ah ok, there *was* a component on the prefab with [ExecuteInEditMode], however, I do not get a warning. When I remove the [ExecuteInEditMode], it works fine