Ejemplo n.º 1
0
        private static void DrawImporterListElement(Rect rect, int index, ReorderableList list, string targetTypeName)
        {
            SerializedProperty importer      = list.serializedProperty.GetArrayElementAtIndex(index);
            SerializedProperty m_Preset      = importer.FindPropertyRelative("m_Preset");
            SerializedProperty m_Association = importer.FindPropertyRelative("m_Association");
            SerializedProperty m_Recursive   = importer.FindPropertyRelative("m_Recursive");

            rect.y     += 1;
            rect.height = EditorGUIUtility.singleLineHeight;
            rect        = EZEditorGUIUtility.DrawReorderableListIndex(rect, index, list);
            float width = (rect.width - recursiveToggleWidth) * 0.5f;

            rect.width = width - margin;

            Color guiColor = GUI.color;

            if (m_Preset.objectReferenceValue != null && (m_Preset.objectReferenceValue as Preset).GetTargetFullTypeName() != targetTypeName)
            {
                GUI.color = Color.red;
            }
            EditorGUI.PropertyField(rect, m_Preset, GUIContent.none);
            GUI.color = guiColor;

            rect.x += width;
            EditorGUI.PropertyField(rect, m_Association, GUIContent.none);
            rect.x    += width;
            rect.width = recursiveToggleWidth;
            EditorGUI.PropertyField(rect, m_Recursive, GUIContent.none);
        }
Ejemplo n.º 2
0
        protected void DrawExtensionListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect        = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_ExtensionList, index);
            rect.height = EditorGUIUtility.singleLineHeight;
            SerializedProperty extension = extensionList.serializedProperty.GetArrayElementAtIndex(index);

            EditorGUI.PropertyField(rect, extension, GUIContent.none);
        }
        private void DrawEnumNameListElement(Rect rect, int index, ReorderableList list)
        {
            var info = enumNameList.list[index] as string;

            rect        = EZEditorGUIUtility.DrawReorderableListIndex(rect, index, list);
            rect.height = EditorGUIUtility.singleLineHeight;
            EditorGUI.TextField(rect, info);
        }
        private void DrawAlwaysIncludedShaderListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            SerializedProperty shaderProperty = m_AlwaysIncludedShaders.GetArrayElementAtIndex(index);

            rect        = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_AlwaysIncludedShaders, index);
            rect.y     += 1;
            rect.height = EditorGUIUtility.singleLineHeight;
            EditorGUI.PropertyField(rect, shaderProperty, GUIContent.none);
        }
Ejemplo n.º 5
0
        protected virtual void DrawPrefabListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect.y += 1;
            rect    = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_Options, index);
            SerializedProperty prefab = optionList.serializedProperty.GetArrayElementAtIndex(index);

            rect.height = EditorGUIUtility.singleLineHeight;
            EditorGUI.PropertyField(rect, prefab, GUIContent.none);
        }
Ejemplo n.º 6
0
        protected void DrawPatternListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_PatternList, index);
            SerializedProperty pattern = patternList.serializedProperty.GetArrayElementAtIndex(index);
            float width = rect.width / 2; float margin = 5;

            EditorGUI.PropertyField(new Rect(rect.x, rect.y, width - margin, EditorGUIUtility.singleLineHeight), pattern.FindPropertyRelative("Key"), GUIContent.none);
            rect.x += width;
            EditorGUI.PropertyField(new Rect(rect.x, rect.y, width - margin, EditorGUIUtility.singleLineHeight), pattern.FindPropertyRelative("Value"), GUIContent.none);
        }
Ejemplo n.º 7
0
        public void DrawCopyListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            SerializedProperty m_PathPair = m_CopyList.GetArrayElementAtIndex(index);
            SerializedProperty m_SrcPath  = m_PathPair.FindPropertyRelative("m_SrcPath");
            SerializedProperty m_DstPath  = m_PathPair.FindPropertyRelative("m_DstPath");

            rect    = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_CopyList, index);
            rect.y += 1; rect.height = EditorGUIUtility.singleLineHeight;
            float width = rect.width / 2; float margin = 5; rect.width = width - margin;

            EditorGUI.PropertyField(rect, m_SrcPath, GUIContent.none);
            rect.x += width;
            EditorGUI.PropertyField(rect, m_DstPath, GUIContent.none);
        }
        private void DrawPropertyListElement(Rect rect, int index, ReorderableList list)
        {
            var info = list.list[index] as PropertyInfo;

            rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, index, list);
            float width = rect.width / 5;

            rect.height = EditorGUIUtility.singleLineHeight;

            rect.width = width - margin;
            EditorGUI.TextField(rect, info.DeclaringType.Name);
            rect.x += width;
            EditorGUI.TextField(rect, info.PropertyType.Name);
            rect.x    += width;
            rect.width = width * 3 - margin;
            EditorGUI.TextField(rect, info.Name);
        }
Ejemplo n.º 9
0
        protected void DrawElementListElement(Rect rect, int index, bool isActive, bool isFocused)
        {
            rect.y += 1;
            rect    = EZEditorGUIUtility.DrawReorderableListIndex(rect, m_Elements, index);
            SerializedProperty element = m_Elements.GetArrayElementAtIndex(index);

            if (m_IsList.boolValue)
            {
                float width = rect.width / 2, space = 5;
                rect.width  = width - space;
                rect.height = EditorGUIUtility.singleLineHeight;
                EZPropertyDrawer.DrawTypeOption(rect, element);
                rect.x += width;
                EZPropertyDrawer.DrawValueContent(rect, element);
            }
            else
            {
                EditorGUI.PropertyField(rect, element);
            }
        }
        private void DrawFieldListElement(Rect rect, int index, ReorderableList list)
        {
            var info = list.list[index] as FieldInfo;

            rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, index, list);
            float width = rect.width / 5;

            rect.height = EditorGUIUtility.singleLineHeight;

            rect.width = width - margin;
            EditorGUI.TextField(rect, info.DeclaringType.Name);
            rect.x += width;
            EditorGUI.TextField(rect, info.FieldType.Name);
            rect.x    += width;
            rect.width = width * 2 - margin;
            EditorGUI.TextField(rect, info.Name);
            rect.x    += width * 2;
            rect.width = width - margin;
            EditorGUI.TextField(rect, info.IsStatic.ToString());
        }
Ejemplo n.º 11
0
        private void DrawPropertyListElement(Rect rect, int index, ReorderableList list)
        {
            var info = list.list[index] as PropertyInfo;

            rect = EZEditorGUIUtility.DrawReorderableListIndex(rect, index, list);
            float width = rect.width / 5;

            rect.height = EditorGUIUtility.singleLineHeight;

            rect.width = width - margin;
            EditorGUI.TextField(rect, info.DeclaringType.Name);
            rect.x += width;
            EditorGUI.TextField(rect, info.PropertyType.Name);
            rect.x    += width;
            rect.width = width * 2 - margin;
            EditorGUI.TextField(rect, info.Name);
            rect.x    += width * 2;
            rect.width = width - margin;
            EditorGUI.TextField(rect, string.Format("{0}/{1}", info.GetMethod == null ? "-" : info.GetMethod.IsStatic.ToString(), info.SetMethod == null ? "-" : info.SetMethod.IsStatic.ToString()));
        }
Ejemplo n.º 12
0
 private void DrawObjectListElement(Rect rect, int index, bool isActive, bool isFocused)
 {
     rect        = EZEditorGUIUtility.DrawReorderableListIndex(rect, index, objectList);
     rect.height = EditorGUIUtility.singleLineHeight;
     EditorGUI.PropertyField(rect, m_ObjectList.GetArrayElementAtIndex(index), GUIContent.none);
 }