Exemple #1
0
 /// <summary>
 /// Initialize native reorderable list by <paramref name="options"/>.
 /// </summary>
 /// <param name="listProperty"></param>
 /// <param name="options"></param>
 protected virtual void InitializeNative(SerializedProperty listProperty, NativeFunctionOptions options)
 {
     Native = new UnityEditorInternal.ReorderableList(
         listProperty.serializedObject,
         listProperty,
         options.Draggable,
         options.DisplayHeader,
         options.DisplayAddButton,
         options.DisplayRemoveButton
         );
 }
Exemple #2
0
        /// <summary>
        ///  Constructor for customizable developpers.
        /// </summary>
        /// <param name="sourceProperty"></param>
        /// <param name="nativeOptions"></param>
        /// <param name="useFoldout"></param>
        public ReorderableList(
            SerializedProperty sourceProperty,
            NativeFunctionOptions nativeOptions,
            bool useFoldout = true)
        {
            if (sourceProperty == null)
            {
                throw new System.ArgumentNullException("listProperty");
            }

            this.SourceProperty = sourceProperty;
            this.UseFoldout     = useFoldout;

            InitializeNative(sourceProperty, nativeOptions);

            InitializeReadyMadeDrawers();
        }