Unity3D研究院之拓展系统自带组件的Inspector视图
转自 http://www.xuanyusong.com/archives/3455
using UnityEngine; using System.Collections; using UnityEditor; public class CameraExtension : Editor { public override void OnInspectorGUI(){ base.DrawDefaultInspector(); if(GUILayout.Button("雨松MOMO")){ } } } [CanEditMultipleObjects()] [CustomEditor(typeof(Camera), true)] public class CustomExtension : CameraExtension { }
如下图所示,可以在系统摄像机组件上添加一个按钮,这样就可以单独来处理逻辑了。