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...
publicoverridevoidOnInspectorGUI(){// 注释这行代码可以把原本的数组给隐藏掉// base.OnInspectorGUI();// 把array里的数据更新到Inspector上serializedObject.Update();// Update the array property's representation in the inspector// 看了下C#源码, 这里绘制了Header, Element等内容, 好像是调用了DrawHeader...
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 ...
using UnityEngine; [CustomEditor(typeof(TestList))] public class TestListInspector : Editor { private ReorderableList m_NameList; private void OnEnable() { m_NameList = new ReorderableList(serializedObject, serializedObject.FindProperty("names"), true, true, true, true); } public override void O...
Adaptive layout 是 是 Default Inspectors Yes 是 Inspector: Edit custom object types 是 是 Inspector: Edit custom property types 是 是 Inspector: Mixed values (multi-editing) support 是 是 Array and list-view control 是 是 Data binding: Serialized properties 是 是其他资源Migrate...
{public string message;public string stackTrace;public LogType type;}#endregion#region Inspector Settings//限制log数量public int maxLogs = 350;public KeyCode HotKey = KeyCode.F12;[Header("Window")][Range(0,1)]public float WinW =1f;[Range(0, 1)]public float WinH = 0.7f;public float ...
private SerializedProperty wishlistProperty; private SerializedProperty pointsProperty; private void OnEnable() { this.wishlistProperty = this.serializedObject.FindProperty("wishlist"); this.pointsProperty = this.serializedObject.FindProperty("points"); } public override void OnInspectorGUI() { this.serialize...
For Assembly Definition Files (.asmdef), click on one of your.asmdeffiles and enable the option in the Inspector window that appears. Use Deterministic CompilationIndicates whether to prevent compilation with the -deterministic C# flag. With this setting enabled, compiled assemblies are byte-for-byte...
一、添加UI UGUI:Unity官方的UI UI创建方式如下: 创建之后,就可以给UI添加组件,如下: 当然也可以直接在Inspector面板中添加 二、Canvas画布 当第一次添加UI时,会自动产生两个物体Canvas和EventSystem Canvas:画布,所有UGUI游戏物体都必须是Canvas的子物体,否则UI游戏物体将无法正常渲染显示,Canvas的宽... 查看原文 ...
Static Batching works for most Renderer objects in Unity that 1) share the same material and 2) are all marked as Static (Select an object in Unity and select the checkbox in the top right of the inspector). GameObjects marked as Static cannot be moved throughout your application's run...