Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Delay showing the dialog until the next editor gui update (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenHodgson authored Feb 15, 2021
1 parent 4b7debd commit 6321e0e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Editor/MixedRealityToolkitInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public override void OnInspectorGUI()
{
case 0:
EditorGUIUtility.PingObject(target);
EditorUtility.DisplayDialog("Attention!", "No root profile for the Mixed Reality Toolkit was found.\n\nYou'll need to create a new one.", "OK");
EditorApplication.delayCall += () =>
EditorUtility.DisplayDialog("Attention!", "No root profile for the Mixed Reality Toolkit was found.\n\nYou'll need to create a new one.", "OK");
break;
case 1:
var rootProfilePath = AssetDatabase.GetAssetPath(rootProfiles[0]);
Expand All @@ -93,9 +94,12 @@ public override void OnInspectorGUI()
};
break;
default:
EditorUtility.DisplayDialog("Attention!", "You must choose a profile for the Mixed Reality Toolkit.", "OK");
currentPickerWindow = GUIUtility.GetControlID(FocusType.Passive);
EditorGUIUtility.ShowObjectPicker<MixedRealityToolkitRootProfile>(null, false, string.Empty, currentPickerWindow);
EditorApplication.delayCall += () =>
{
EditorUtility.DisplayDialog("Attention!", "You must choose a profile for the Mixed Reality Toolkit.", "OK");
currentPickerWindow = GUIUtility.GetControlID(FocusType.Passive);
EditorGUIUtility.ShowObjectPicker<MixedRealityToolkitRootProfile>(null, false, string.Empty, currentPickerWindow);
};
break;
}

Expand Down

0 comments on commit 6321e0e

Please sign in to comment.