コード例 #1
0
        protected void EndList(IPropertyContainer container, IListProperty property)
        {
            CurrentListProperty = null;
            if (ShouldHide(property))
            {
                return;
            }
            PopEnabledState();

            if (CanDrawAsList(property))
            {
                // Commit any removed items
                if (RemoveAtIndex >= 0)
                {
                    property.RemoveAt(container, RemoveAtIndex);
                    RemoveAtIndex = -1;
                }

                if (Targets.Count > 1)
                {
                    return;
                }
                EditorGUILayout.BeginHorizontal();

                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Add", GUILayout.Width(32.0f), GUILayout.Height(16.0f)))
                {
                    property.AddNewItem(container);
                }
                GUILayout.Space(15.0f);

                EditorGUILayout.EndHorizontal();
                EditorGUILayout.EndVertical();
                GUILayout.Space(5.0f);
                EditorGUILayout.EndHorizontal();
            }
        }
コード例 #2
0
 public void RemoveAt(int index)
 {
     m_ItemsProperty?.RemoveAt(this, index);
 }