1. 获取选中对象的相对路径:
AssetDatabase.GetAssetOrScenePath(Selection.activeGameObject).Replace('/', '\\');
2. 获取选中对象的完整路径:
var path = AssetDatabase.GetAssetOrScenePath(Selection.activeGameObject);
var fullPath = Path.GetFullPath(path);
3. 复制文本到剪切板:
GUIUtility.systemCopyBuffer = value;
4. 在扩展窗口选择对象:(如果需要选择字体,图片类型,则修改type)
(GameObject)EditorGUILayout.ObjectField(prefabTag, typeof(GameObject), true);
5. 打开并选择文件夹:
EditorUtility.OpenFolderPanel
6. 保存资源的修改:
AssetDatabase.SaveAssets();
7. 刷新资源:
AssetDatabase.Refresh();
8. 提示框:
EditorUtility.DisplayDialog("DisplayDialog", "Finished, you can close thi