File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -39,21 +39,31 @@ private void DrawBottomTips()
3939 private void DrawFindObjectContent ( )
4040 {
4141 GUILayout . BeginHorizontal ( ) ;
42- EditorGUILayout . LabelField ( "Path/Guid" , GUILayout . Width ( 60 ) ) ;
42+ EditorGUILayout . LabelField ( "Path/Guid/InstanceId " , GUILayout . Width ( 120 ) ) ;
4343 _assetIdentifier = EditorGUILayout . TextField ( _assetIdentifier ) ;
4444 EditorGUI . BeginDisabledGroup ( string . IsNullOrEmpty ( _assetIdentifier ) ) ;
4545 if ( GUILayout . Button ( "Find" , GUILayout . Width ( 60 ) ) )
4646 {
47- FindObjectByPathOrGuid ( ) ;
47+ FindObject ( ) ;
4848 }
4949 EditorGUI . EndDisabledGroup ( ) ;
5050 GUILayout . EndHorizontal ( ) ;
5151 }
5252
53- private void FindObjectByPathOrGuid ( )
53+ private void FindObject ( )
5454 {
5555 Assert . IsTrue ( ! string . IsNullOrEmpty ( _assetIdentifier ) ) ;
5656
57+ if ( int . TryParse ( _assetIdentifier , out int instanceId ) )
58+ {
59+ UObject obj = EditorUtility . InstanceIDToObject ( instanceId ) ;
60+ if ( obj )
61+ {
62+ EditorGUIUtility . PingObject ( obj ) ;
63+ return ;
64+ }
65+ }
66+
5767 string filePath = AssetDatabase . GUIDToAssetPath ( _assetIdentifier ) ;
5868 if ( string . IsNullOrEmpty ( filePath ) )
5969 {
You can’t perform that action at this time.
0 commit comments