显示复杂对话框
using UnityEngine; using UnityEditor; /// <summary> /// 编辑器工具 /// </summary> public class EditorUtilityTest { [MenuItem("Test/DisplayDialogComplex")] public static void DisplayDialogComplex() { int option = EditorUtility.DisplayDialogComplex("title", "message", "ok", "cancel", "alt"); Debug.Log("option=" + option); switch(option){ case 0: break; case 1: break; case 2: break; default: Debug.LogError("Unrecognized option."); break; } } }
效果