35 lines
797 B
C#
35 lines
797 B
C#
|
|
using UnityEditor;
|
|||
|
|
using UnityEngine;
|
|||
|
|
|
|||
|
|
public abstract class EditorWindowTabBase
|
|||
|
|
{
|
|||
|
|
internal virtual void OnEnable()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
internal virtual void OnDisable()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
internal virtual void OnGUI()
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected void DrawPathSelection(string label, ref string path)
|
|||
|
|
{
|
|||
|
|
EditorGUILayout.BeginHorizontal();
|
|||
|
|
{
|
|||
|
|
path = EditorGUILayout.TextField(label, path);
|
|||
|
|
if (GUILayout.Button("浏览...", GUILayout.Width(60)))
|
|||
|
|
{
|
|||
|
|
string newPath = EditorUtility.SaveFolderPanel("选择输出目录", path, "");
|
|||
|
|
if (!string.IsNullOrEmpty(newPath))
|
|||
|
|
{
|
|||
|
|
path = newPath;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
EditorGUILayout.EndHorizontal();
|
|||
|
|
}
|
|||
|
|
}
|