转自 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 { }
如下图所示,可以在系统摄像机组件上添加一个按钮,这样就可以单独来处理逻辑了。
时间: 2024-10-08 21:02:08