31 lines
		
	
	
		
			675 B
		
	
	
	
		
			C#
		
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			675 B
		
	
	
	
		
			C#
		
	
	
| namespace Guru.Editor
 | |
| {
 | |
|     using UnityEditor;
 | |
|     using UnityEngine;
 | |
|     
 | |
|     public class GuruEditorHelper
 | |
|     {
 | |
|         public static string GetFilePath(string filter)
 | |
|         {
 | |
|             var guids = AssetDatabase.FindAssets(filter);
 | |
|             if (guids != null && guids.Length > 0)
 | |
|             {
 | |
|                 var path = AssetDatabase.GUIDToAssetPath(guids[0]);
 | |
|                 return path;
 | |
|             }
 | |
|             return "";
 | |
|         }
 | |
| 
 | |
|         public static void OpenPath(string path)
 | |
|         {
 | |
| #if UNITY_EDITOR_OSX
 | |
|             EditorUtility.RevealInFinder(path);
 | |
|             return;
 | |
| #endif
 | |
|             Application.OpenURL($"file://{path}");
 | |
|         }
 | |
| 
 | |
| 
 | |
| 
 | |
|     }
 | |
| } |