Search Unity

Camera viewport changes don't reset when exiting Play mode

Discussion in 'Editor & General Support' started by Livealot, Sep 18, 2019.

  1. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    228
    I have a runtime script that changes a camera viewport based on orientation and SafeArea. When I exit Play Mode, the editor settings for that camera are locked to the last value at runtime. I expected that those values would return to the defaults (prior to entering Play Mode).

    The script has the ExecuteInEditMode attribute, which is probably the issue here.

    Is there a way to know when you're exiting Play Mode so that I could have the same scripts perform the reset?
     
    Last edited: Sep 18, 2019
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Livealot likes this.
  3. Livealot

    Livealot

    Joined:
    Sep 2, 2013
    Posts:
    228
    Thanks Joe. If I could close or mark the thread solved, I would!
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I think most people just add [SOLVED] to the title, or just leave it be.