Esempio n. 1
0
 public static void AddRange(this SerializedProperty arrayProperty, IList elements)
 {
     for (int i = 0; i < elements.Count; i++)
     {
         arrayProperty.Add(elements[i]);
     }
 }
Esempio n. 2
0
        public static void EnsureCapacity(this SerializedProperty arrayProperty, int capacity, System.Func <object> getDefaultValue = null)
        {
            getDefaultValue = getDefaultValue ?? delegate { return(null); };

            while (arrayProperty.arraySize < capacity)
            {
                arrayProperty.Add(getDefaultValue());
            }
        }
Esempio n. 3
0
        public static SerializedProperty Insert(this SerializedProperty arrayProperty, object element, int index)
        {
            SerializedProperty elementProperty;

            elementProperty = arrayProperty.Add(element);
            arrayProperty.MoveArrayElement(arrayProperty.arraySize - 1, index);

            return(elementProperty);
        }
Esempio n. 4
0
 public void AddComponent(IComponentOld component, int index)
 {
     Components.Add(component);
     ComponentIndices.Add(index);
     DummyValue.Add(component.GetTypeName());
 }