当我们在编辑界面要批量设置游戏资源的时候,就需要从UnityEditor里面继承,实现自己的窗口类。
所幸UNITY提供了最简单的一个自定义窗体类,我们直接往上扔public类型的属性就好,提供了确认和取消两种按钮。
using UnityEngine; using System.Collections.Generic; using UnityEditor; public class Plugin_LoadingData : ScriptableWizard { [MenuItem ("GameObject/Data Setting/Loading text")] static void CreateWizard () { DisplayWizard<Plugin_LoadingData> ("配置登陆提示文字", "确认", "取消"); } // This is called when the user clicks on the Create button. void OnWizardCreate () { Debug.Log ("确认"); } // Allows you to provide an action when the user clicks on the // other button "Apply". void OnWizardOtherButton () { Debug.Log ("取消"); } }