显示一个模态对话框
using UnityEngine; using UnityEditor; using System.Collections; /// <summary> /// 编辑器工具 /// </summary> public class EditorUtilityTest { [MenuItem("Test/DisplayDialog")] public static void DisplayDialog() { bool ok = EditorUtility.DisplayDialog("title", "message", "ok", "cancel"); Debug.Log("ok="+ok); } }
效果