Skip to content

Commit 88ebbdb

Browse files
author
Bruno Mikoski
committed
add: changed collection wizzard to modal, so It can loose focus without closing it.
1 parent a7671d3 commit 88ebbdb

2 files changed

Lines changed: 13 additions & 3 deletions

File tree

CHANGELOG.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
176176
- First initial working version
177177

178178
### [Unreleased]
179+
### Changed
180+
- Changed Create Collection Wizzard to behave like a modal window that can loose focus.
181+
179182

180183
[1.3.2]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.3.2
181184
[1.3.1]: https://github.com/badawe/ScriptableObjectCollection/releases/tag/v1.3.1

Scripts/Editor/CreateCollectionWizzard.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,24 @@ private static string LastGeneratedCollectionScriptPath
127127
private string collectableName = "Collectable";
128128
private static string targetFolder;
129129
private bool generateIndirectAccess = true;
130+
131+
private static CreateCollectionWizzard windowInstance;
130132

131133
public static CreateCollectionWizzard GetWindowInstance()
132134
{
133-
return GetWindow<CreateCollectionWizzard>("Creating New Collection");
135+
if (windowInstance == null)
136+
{
137+
windowInstance = CreateInstance<CreateCollectionWizzard>();
138+
windowInstance.titleContent = new GUIContent("Create New Collection");
139+
}
140+
141+
return windowInstance;
134142
}
135143

136144
public static void Show(string targetPath)
137145
{
138146
targetFolder = targetPath;
139-
CreateCollectionWizzard createCollectionWizzard = GetWindowInstance();
140-
createCollectionWizzard.ShowPopup();
147+
GetWindowInstance().ShowUtility();
141148
}
142149

143150
private void OnGUI()

0 commit comments

Comments
 (0)