学习NGUI插件的时候,突然间有一个问题为什么它这些属性可以通过弹出窗口来选中呢? 而我自己写的组件只能使用手动拖放的方式=.=. Unity开发了组件Inspector视图扩展API,如果我们要写插件方便别人来使用,使用编辑器扩展API让我们的组件显示的更华丽,使用方便 Texture弹出选择框选中图片赋值: 1个组件对应1个Edit扩展器,继承Editor必须让入Editor文件夹下 MyComponent: using UnityEngine; using System.Collectio
自定义检视面板的使用: 先是定义一个脚本文件,我们来修饰它的检视面板: [HelpURL("http://www.baidu.com")] public class Atr : MonoBehaviour { public int id; public string Name; [Multiline()] public string BackStory; public float health; public float damage; public float weaponDamag
http://blog.csdn.net/akof1314/article/details/38129031 假设有一个敌人生成器类,其中有个属性range用来表示敌人生成的范围区域大小,那么可以用OnDrawGizmos函数来绘制它在场景视图所代表的区域大小,便于开发调试.这个敌人生成器类,类似如下: 12345678910111213141516171819 using UnityEngine;using System.Collections; public class EnemySpa
本文转自http://catlikecoding.com/unity/tutorials/editor/custom-list/ Custom List, displaying data your way In this Unity C# tutorial you will create a custom visualization for arrays and lists in the editor. You will learn to create a custom editor use S
https://www.xuanyusong.com/archives/category/unity/unity3deditor 1 using UnityEngine; public class Test : MonoBehaviour { public Rect rect; public Texture texture; } using UnityEngine; using UnityEditor; [CustomEditor(typeof(Test))] public class MyEd
代码: using UnityEditor;using UnityEngine; public class ChangeValue : ScriptableWizard { public int health = 10; public int speed = 23; [MenuItem("Tools/CreateWizard")] static void CreateWizard() {