public override void Draw() { int len = m_Elements.Count; m_Foldout = EditorGUILayout.Foldout(m_Foldout, m_Label); if (m_Foldout) { YHEditorTools.PushIndentLevel(m_Deep + 1); YHEditorTools.PushLabelWidth(80); GUILayout.BeginVertical(); //数组大小 int newLen = EditorGUILayout.IntField("size", len); if (newLen != len) { ChangeLength(newLen); } //数组元素 for (int i = 0; i < m_Elements.Count; ++i) { object oldElementValue = m_Elements[i].value; m_Elements[i].Draw(); if (m_Elements[i].value != oldElementValue) { ReflectionUtils.InvokeMethod(m_Value, "SetValue", new object[] { m_Elements[i].value, i }); } } GUILayout.EndVertical(); YHEditorTools.PopLabelWidth(); YHEditorTools.PopIndentLevel(); } }
public override void Draw() { YHEditorTools.PushIndentLevel(m_Deep); m_Value = YHGUI.DrawElement(m_Value, m_Type, m_Label); YHEditorTools.PopIndentLevel(); }