Skip to content

Fixed a series of exceptions happening when trying to load an asset during wizard execution (1262171). #1312

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 2 commits into from
Jul 16, 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
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Remove MSAA debug mode when renderpipeline asset has no MSAA
- Fixed some post processing using motion vectors when they are disabled
- Fixed the multiplier of the environement lights being overriden with a wrong value for ray tracing (1260311).
- Fixed a series of exceptions happening when trying to load an asset during wizard execution (1262171).

### Changed
- Improve MIP selection for decals on Transparents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,14 @@ class QueuedLauncher
Queue<Action> m_Queue = new Queue<Action>();
bool m_Running = false;
bool m_StopRequested = false;
bool m_OnPause = false;

public void Stop() => m_StopRequested = true;

// Function to pause/unpause the action execution
public void Pause() => m_OnPause = true;
public void Unpause() => m_OnPause = false;

public int remainingFixes => m_Queue.Count;

void Start()
Expand All @@ -242,7 +247,12 @@ void Run()
m_StopRequested = false;
}
if (m_Queue.Count > 0)
m_Queue.Dequeue()?.Invoke();
{
if (!m_OnPause)
{
m_Queue.Dequeue()?.Invoke();
}
}
else
End();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ static class ObjectSelector
public static bool opened
=> Resources.FindObjectsOfTypeAll(typeof(PlayerSettings).Assembly.GetType("UnityEditor.ObjectSelector")).Length > 0;

// Action to be called with the window is closed
static Action s_OnClose;

static ObjectSelector()
{
Type playerSettingsType = typeof(PlayerSettings);
Expand Down Expand Up @@ -73,12 +76,22 @@ static ObjectSelector()
GetCurrentObject = getCurrentObjectLambda.Compile();
}

public static void Show(UnityEngine.Object obj, Type type, Action<UnityEngine.Object> onChangedObject)
public static void Show(UnityEngine.Object obj, Type type, Action<UnityEngine.Object> onChangedObject, Action onClose)
{
id = GUIUtility.GetControlID("s_ObjectFieldHash".GetHashCode(), FocusType.Keyboard);
GUIUtility.keyboardControl = id;
ShowObjectSelector(obj, type, onChangedObject);
selectorID = id;
ObjectSelector.s_OnClose = onClose;
EditorApplication.update += CheckClose;
}
static void CheckClose()
{
if (!opened)
{
ObjectSelector.s_OnClose?.Invoke();
EditorApplication.update -= CheckClose;
}
}

public static void CheckAssignationEvent<T>(Action<T> assignator)
Expand Down Expand Up @@ -132,8 +145,12 @@ void CreateOrLoad<T>(Action onCancel, Action<T> onObjectChanged)
onCancel?.Invoke();
break;
case 2: //Load
ObjectSelector.Show(target, typeof(T), o => onObjectChanged?.Invoke((T)o));
break;
{
m_Fixer.Pause();
ObjectSelector.Show(target, typeof(T), o => onObjectChanged?.Invoke((T)o), m_Fixer.Unpause);
break;
}

default:
throw new ArgumentException("Unrecognized option");
}
Expand Down