private void OnEnable()
    {
        var property = this.serializedObject.FindProperty("deviceSettings");

        this.list2 = ReorderableListUtility.CreateAutoLayout(
            property,
            new string[] { "Raw Path Name", "Display Name", "Display Color" }
            );
    }
Ejemplo n.º 2
0
    private void OnEnable()
    {
        var property = this.serializedObject.FindProperty("levels");

        this.list1 = ReorderableListUtility.CreateAutoLayout(
            property);
        //,new string[] { "Element", "Level Name"},
        //new float?[] { 100, 70 });
    }
Ejemplo n.º 3
0
    private void OnEnable()
    {
        var property = this.serializedObject.FindProperty("Drinks");

        this.list1 = ReorderableListUtility.CreateAutoLayout(property);
        this.list2 = ReorderableListUtility.CreateAutoLayout(
            property,
            new string[] { "Drink Name", "Cost", "Key Color" },
            new float?[] { 100, 70 });
    }
    private void OnEnable()
    {
        var property = serializedObject.FindProperty("PrefabLevels");

        list1 = ReorderableListUtility.CreateAutoLayout(
            property,
            new[] { "Order", "Level", "In Loop" },
            new float?[] { 50, 150, 70 });

        if (_isUseDebugLevel && debugLevel == null)
        {
            _isUseDebugLevel = false;
        }

        /*this.list2 = ReorderableListUtility.CreateAutoLayout(
         *  property,
         *  new string[] { "Drink Name", "Cost", "Key Color" },
         *  new float?[] { 100, 70 });
         * }*/
    }
Ejemplo n.º 5
0
    private void OnEnable()
    {
        var propertyAvailableTetrimini = this.serializedObject.FindProperty("m_availableTetrimini");

        this.m_availableTetriminiList = ReorderableListUtility.CreateAutoLayout(propertyAvailableTetrimini, new string[] { "Name", "Geometry", "Color" });
    }
Ejemplo n.º 6
0
    public override void OnGUI(Rect p_position, SerializedProperty p_property, GUIContent p_label)
    {
        string _path = p_property.propertyPath;

        if (!_path.EndsWith("]"))
        {
            EditorGUI.LabelField(p_position, p_label.text, "[ReorderableList] Only for Array Or Collection");
            return;
        }

        ReorderableListAttribute _reorderableList = attribute as ReorderableListAttribute;
        bool _isFirst = _path.EndsWith(".data[0]");

        if (_reorderableList.list != null)
        {
            if (_isFirst)
            {
                Rect _butRect = new Rect(p_position);
                int  _indent  = EditorGUI.indentLevel * 15;
                _butRect.height = 16;
                if (useOrder)
                {
                    _butRect.x     += _indent + 70;
                    _butRect.width -= _indent + 70 + 160;
                    if (GUI.Button(_butRect, "Finish Reorder"))
                    {
                        useOrder = false;
                    }
                }
                else
                {
                    _butRect.x     += _indent;
                    _butRect.width -= _indent + 160;
                    if (GUI.Button(_butRect, "Start Reorder"))
                    {
                        useOrder = true;
                    }
                }

                _butRect.x    += _butRect.width;
                _butRect.width = 160;
                SerializedProperty _parentProperty = SerializedPropertyValue.GetParent(p_property);
                SerializedPropertyValue.DrawCopyPasteArray(_butRect, _parentProperty);
            }
        }

        SerializedObject _serializedObject = p_property.serializedObject;

        if (_isFirst)
        {
            if (_reorderableList.list == null)
            {
                SerializedProperty _parentProperty = SerializedPropertyValue.GetParent(p_property);
                _reorderableList.list = ReorderableListUtility.CreateAutoLayout(_parentProperty, 4, SerializedPropertyValue.DrawCopyPasteBehind);
            }
        }

        if (useOrder)
        {
            if (_isFirst)
            {
                p_position.width -= 120;
                ReorderableListUtility.DoListWithFoldout(_reorderableList.list, p_position);
            }
        }
        else
        {
            p_position.y += 16;

            Rect _copyPasteRect = new Rect(p_position);
            _copyPasteRect.x     += p_position.width - 120;
            _copyPasteRect.width  = 120;
            _copyPasteRect.height = 18;
            string _click = SerializedPropertyValue.DrawCopyPasteButton(_copyPasteRect, p_property);
            if (_click != "")
            {
            }
            else if ((p_property.propertyType == SerializedPropertyType.Generic) || (p_property.isArray && (p_property.propertyType != SerializedPropertyType.String)))
            {
                EditorGUI.PropertyField(p_position, p_property, p_label, true);
            }
            else
            {
                p_position.width -= 120;
                p_position.height = SerializedPropertyValue.GetPropertyHeight(p_property, p_label);
                EditorGUI.PropertyField(p_position, p_property);
            }
        }
    }