Ejemplo n.º 1
0
        protected void OnAdd(ReorderableList list)
        {
            int index = KeysProperty.arraySize;

            KeysProperty.InsertArrayElementAtIndex(index);
            ValuesProperty.InsertArrayElementAtIndex(index);
        }
Ejemplo n.º 2
0
 protected virtual void CheckRedBoxForElement(Rect rect, SerializedProperty keyProp, int index)
 {
     if (KeysProperty.HasAnyElementSameValue(keyProp, index))
     {
         DrawRedBox(rect, redBoxSize, redBoxStyle, redBoxOffset);
         hasDuplicatedKey = true;
     }
 }
Ejemplo n.º 3
0
        protected float GetReorderableElementHeight(int index)
        {
            float keyHeight   = EditorGUI.GetPropertyHeight(KeysProperty.GetArrayElementAtIndex(index));
            float valueHeight = EditorGUI.GetPropertyHeight(ValuesProperty.GetArrayElementAtIndex(index));
            float height      = 8 + Math.Max(keyHeight, valueHeight);

            if (!IsDragging || (IsDragging && elementHeight < height))
            {
                elementHeight = height;
            }
            return(elementHeight);
        }
Ejemplo n.º 4
0
        protected virtual void DrawElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect.position = new Vector2(rect.position.x + 10, rect.position.y);
            SerializedProperty key   = KeysProperty.GetArrayElementAtIndex(index);
            SerializedProperty value = ValuesProperty.GetArrayElementAtIndex(index);
            float   halfSizeX        = rect.size.x / 2;
            float   leftOffset       = 100;
            float   rightOffset      = 58;
            Vector2 sizeKey          = new Vector2(halfSizeX - leftOffset, rect.size.y);
            Vector2 sizeValue        = new Vector2(halfSizeX + rightOffset, rect.size.y);
            Vector2 positionValue    = rect.position + new Vector2(sizeKey.x + 25, 0);

            float oldWidth = EditorGUIUtility.labelWidth;

            EditorGUIUtility.labelWidth = 50;
            OnBeforeDrawProperties();
            rect = DrawPropertiesForElement(new Rect(rect.position, sizeKey), new Rect(positionValue, sizeValue), key, value);
            OnAfterDrawProperties();
            EditorGUIUtility.labelWidth = oldWidth;

            CheckRedBoxForElement(rect, key, index);
        }
Ejemplo n.º 5
0
 protected void OnRemove(ReorderableList list)
 {
     KeysProperty.DeleteArrayElementAtIndex(SelectedIndex);
     ValuesProperty.DeleteArrayElementAtIndex(SelectedIndex);
 }
Ejemplo n.º 6
0
 static ppy_video()
 {
     TableNameProperty.AddOwner(typeof(ppy_video), "ppy_video");
     KeysProperty.AddOwner(typeof(ppy_video), new string[] { "Id" });
 }
Ejemplo n.º 7
0
 set => SetValue(KeysProperty, value);