publicoverridevoidOnInspectorGUI(){// 注释这行代码可以把原本的数组给隐藏掉// base.OnInspectorGUI();// 把array里的数据更新到Inspector上serializedObject.Update();// Update the array property's representation in the inspector// 看了下C#源码, 这里绘制了Header, Element等内容, 好像是调用了DrawHeader...
public class InspectorExample : MonoBehaviour { //序列化 [SerializeField] public int[] intArray; [SerializeField] public List<string> stringList; } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. using UnityEditor; [CustomEditor(typeof(InspectorExample))] public class InspectorExampleEditor : Edit...
Disables reordering of an array or list in the Inspector window. By default, array or list script variables are presented with a UI control that allows array element reordering via drag handles to the left of element content. You can use [NonReorderable] attribute on a script array or list ...
A Unity Extension to Expose Properties in the the Unity Inspector for Monobehaviours unityunity3dunityengineasset UpdatedApr 7, 2018 C# Load more… Add a description, image, and links to theunityenginetopic page so that developers can more easily learn about it. ...
新建一个编辑器脚本文件TestListInspector.cs,代码如下: using UnityEditor; using UnityEditorInternal; using UnityEngine; [CustomEditor(typeof(TestList))] public class TestListInspector : Editor { private ReorderableList m_NameList; private void OnEnable() ...
In the Project window, selectNew Game Switch List Asset. This shows a list of toggles in the Inspector. You can reorder the list, collapse it, add entries to or remove entries from the list, and change the number of entries in the list. If you make changes in the Inspector UI, thesw...
Inspector: The components (properties) of the selected object in the scene. Toolbar: To the far left are Pan, Move, Rotate, Scale and in the center Play, Pause, Advance Frame. Clicking Play plays the game near instantly without having to perform separate builds. Pause pauses the game, and...
首先在面板上隐藏默认的List绘制方法,使用HideInInspector隐藏属性: 代码语言:javascript 复制 publicclassPistonE03:MonoBehaviour{publicfloat Speed;publicVector3 AddForceWhenHittingPlayer;//We are hiding this in the inspector because we want to draw our own custom//inspector for it.[HideInInspector]publicLi...
Editor; [CustomEditor(typeof(SampleBehaviour))] public class SampleEditor : ToolboxEditor { private void OnEnable() { } private void OnDisable() { } public override void DrawCustomInspector() { base.DrawCustomInspector(); //for custom properties: // - ToolboxEditorGui.DrawToolboxProperty(...
When configuring aUnityEventin theInspectorwindow there are two types of function calls that are supported: Staticcalls are entirely preconfigured at authoring time, with their target and parameter values defined in the Inspector window. When the callback is invoked, the target function is invoked ...