Skip to content

Commit

Permalink
close if open
Browse files Browse the repository at this point in the history
  • Loading branch information
L1247 committed Jan 13, 2023
1 parent 6e5b6e8 commit b126388
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -946,15 +946,18 @@ private string GetNameOfCategory(int index)
[MenuItem("Window/Bookmark Everything %h")]
private static void Init()
{
var windows = (BookmarkEverythingEditor[])Resources.FindObjectsOfTypeAll(typeof(BookmarkEverythingEditor));
if (windows.Length == 0)
var hasOpenInstances = HasOpenInstances<BookmarkEverythingEditor>();
var window = GetWindow<BookmarkEverythingEditor>();
// var windows = (BookmarkEverythingEditor[])Resources.FindObjectsOfTypeAll(typeof(BookmarkEverythingEditor));
if (hasOpenInstances)
{
BookmarkEverythingEditor window = (BookmarkEverythingEditor)GetWindow(typeof(BookmarkEverythingEditor));
window.InitInternal();
// FocusWindowIfItsOpen(typeof(BookmarkEverythingEditor));
window.Close();
}
else
{
FocusWindowIfItsOpen(typeof(BookmarkEverythingEditor));
// BookmarkEverythingEditor window = (BookmarkEverythingEditor)GetWindow(typeof(BookmarkEverythingEditor));
window.InitInternal();
}
}

Expand Down
4 changes: 2 additions & 2 deletions BookmarkEverything/UserSettings/EditorUserSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ EditorUserSettings:
serializedVersion: 4
m_ConfigSettings:
RecentlyUsedSceneGuid-0:
value: 5507520757065b0f590d092612260f44124f1c2e7c7d7e342f2c4b60b4b4323d
value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661
flags: 0
RecentlyUsedSceneGuid-1:
value: 515250075c0c595e5f5a5e71122159444e4e4a2f7a7d7f602f284d66b4b76661
value: 5507520757065b0f590d092612260f44124f1c2e7c7d7e342f2c4b60b4b4323d
flags: 0
vcSharedLogLevel:
value: 0d5e400f0650
Expand Down

0 comments on commit b126388

Please sign in to comment.