Skip to content

Commit

Permalink
feat: open scene if entry is SceneAsset
Browse files Browse the repository at this point in the history
  • Loading branch information
L1247 committed Jan 9, 2023
1 parent d33a729 commit 6e5b6e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEngine;
using Object = UnityEngine.Object;

Expand Down Expand Up @@ -652,7 +653,13 @@ private void DrawProjectFinderEntries(string category)
else if (_pingType == PingTypes.OpenAndSelect)
{
if (Selection.activeObject) Selection.activeObject = null;
if (Path.HasExtension(path)) Selection.activeObject = AssetDatabase.LoadMainAssetAtPath(path);
if (Path.HasExtension(path))
{
var assetAtPath = AssetDatabase.LoadMainAssetAtPath(path);
var entryIsScene = assetAtPath is SceneAsset;
if (entryIsScene) EditorSceneManager.OpenScene(path , OpenSceneMode.Single);
Selection.activeObject = assetAtPath;
}
else OpenDir(path);
}

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

0 comments on commit 6e5b6e8

Please sign in to comment.