Skip to content

Commit

Permalink
open if prefab
Browse files Browse the repository at this point in the history
  • Loading branch information
L1247 committed Jan 18, 2023
1 parent b126388 commit e5fd81e
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -655,10 +655,12 @@ private void DrawProjectFinderEntries(string category)
if (Selection.activeObject) Selection.activeObject = null;
if (Path.HasExtension(path))
{
var assetAtPath = AssetDatabase.LoadMainAssetAtPath(path);
var entryIsScene = assetAtPath is SceneAsset;
var asset = AssetDatabase.LoadMainAssetAtPath(path);
var entryIsScene = asset is SceneAsset;
var prefabType = PrefabUtility.GetPrefabType(asset);
if (entryIsScene) EditorSceneManager.OpenScene(path , OpenSceneMode.Single);
Selection.activeObject = assetAtPath;
else if (prefabType == PrefabType.Prefab) AssetDatabase.OpenAsset(asset);
Selection.activeObject = asset;
}
else OpenDir(path);
}
Expand Down

0 comments on commit e5fd81e

Please sign in to comment.