Skip to content

Fixed an issue where entering playmode would close the LookDev window. #1937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void OnEnable()
// in case the window where open when last editor session finished.
// (Else it will open at start and has nothing to display).
if (!LookDev.open)
LookDev.Open();
LookDev.Initialize(this);

titleContent = Style.k_WindowTitleAndIcon;

Expand Down
15 changes: 9 additions & 6 deletions com.unity.render-pipelines.core/Editor/LookDev/LookDev.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ internal static void SaveConfig(string path = lastRenderingDataSavePath)
/// <summary>Open the LookDev window</summary>
public static void Open()
{
var Window = EditorWindow.GetWindow<DisplayWindow>();
s_ViewDisplayer = Window;
s_EnvironmentDisplayer = Window;
ConfigureLookDev(reloadWithTemporaryID: false);
EditorWindow.GetWindow<DisplayWindow>();
}

/// <summary>Close the LookDev window</summary>
Expand All @@ -108,6 +105,14 @@ public static void Close()
s_EnvironmentDisplayer = null;
}

internal static void Initialize(DisplayWindow window)
{
s_ViewDisplayer = window;
s_EnvironmentDisplayer = window;
open = true;
ConfigureLookDev(reloadWithTemporaryID: false);
}

[Callbacks.DidReloadScripts]
static void OnEditorReload()
{
Expand Down Expand Up @@ -158,8 +163,6 @@ static void ConfigureRenderer(bool reloadWithTemporaryID)

static void LinkViewDisplayer()
{
EditorApplication.playModeStateChanged += state => Close();

s_ViewDisplayer.OnClosed += () =>
{
s_Compositor?.Dispose();
Expand Down
2 changes: 2 additions & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Light quality setting for contact shadow set to on for High quality by default.
- Fixed an exception thrown when closing the look dev because there is no active SRP anymore.
- Fixed alignment of framesettings in HDRP Default Settings
- Fixed an exception thrown when closing the look dev because there is no active SRP anymore.
- Fixed an issue where entering playmode would close the LookDev window.

### Changed
- Preparation pass for RTSSShadows to be supported by render graph.
Expand Down