Example #1
0
    private void DrawNameSingleList(Rect rect, int index, bool selected, bool focused)
    {
        SerializedProperty element = ListSingleList.serializedProperty.GetArrayElementAtIndex(index);

        rect.y     += 2;
        rect.height = EditorGUIUtility.singleLineHeight;
        EditorGUI.PropertyField(new Rect(rect.x + 2 * rect.width / 3, rect.y, rect.width / 5, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("MyType"), GUIContent.none);
        EditorGUI.LabelField(new Rect(rect.width - 10, rect.y, 40, EditorGUIUtility.singleLineHeight), "ToInt");
        EditorGUI.PropertyField(new Rect(rect.width - 25, rect.y, 10, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("IsInt"), GUIContent.none);

        EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width / 3.6f, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("Name"), GUIContent.none);
        GetBackType ShowType = (GetBackType)element.FindPropertyRelative("MyType").enumValueIndex;

        if (ShowType == GetBackType.Text)
        {
            EditorGUI.PropertyField(new Rect(rect.x + rect.width / 3.5f, rect.y, rect.width / 3.5f, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("Showtext"), GUIContent.none);
        }
        if (ShowType == GetBackType.InputText)
        {
            EditorGUI.PropertyField(new Rect(rect.x + rect.width / 3.5f, rect.y, rect.width / 3.5f, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("ShowInputtext"), GUIContent.none);
        }
        if (ShowType == GetBackType.Event)
        {
            EditorGUI.PropertyField(new Rect(rect.x + rect.width / 4.5f, rect.y, rect.width / 4.5f, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("SendData"), GUIContent.none);
            EditorGUI.PropertyField(new Rect(rect.x + rect.width / 4.5f * 2, rect.y, rect.width / 4.5f, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("EventName"), GUIContent.none);
        }
        //EditorGUI.PropertyField(rect, element, GUIContent.none);
    }
Example #2
0
    private void DrawNameSingleList(Rect rect, int index, bool selected, bool focused)
    {
        SerializedProperty element = ListSingleList.serializedProperty.GetArrayElementAtIndex(index);

        rect.y     += 2;
        rect.height = EditorGUIUtility.singleLineHeight;
        EditorGUI.PropertyField(new Rect(rect.width - rect.width / 5 - 80, rect.y, 20, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("IsDis"), GUIContent.none);
        if (element.FindPropertyRelative("IsDis").boolValue)
        {
            EditorGUI.PropertyField(new Rect(rect.width - rect.width / 5 - 40, rect.y, 40, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("DisNub"), GUIContent.none);
        }
        EditorGUI.PropertyField(new Rect(rect.width - rect.width / 5, rect.y, rect.width / 8, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("MyType"), GUIContent.none);

        EditorGUI.PropertyField(new Rect(rect.x, rect.y, 15, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("IsSave"), GUIContent.none);

        EditorGUI.PropertyField(new Rect(rect.x + 16, rect.y, rect.width / 3.6f, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("Name"), GUIContent.none);

        GetBackType ShowType = (GetBackType)element.FindPropertyRelative("MyType").enumValueIndex;

        if (ShowType == GetBackType.Text)
        {
            EditorGUI.PropertyField(new Rect(rect.x + rect.width / 3.5f, rect.y, rect.width / 3.5f, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("Showtext"), GUIContent.none);
            EditorGUI.LabelField(new Rect(rect.width - 10, rect.y, 40, EditorGUIUtility.singleLineHeight), "ToInt");
            EditorGUI.PropertyField(new Rect(rect.width - 25, rect.y, 10, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("IsInt"), GUIContent.none);
        }
        if (ShowType == GetBackType.InputText)
        {
            EditorGUI.PropertyField(new Rect(rect.x + rect.width / 3.5f, rect.y, rect.width / 3.5f, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("ShowInputtext"), GUIContent.none);
            EditorGUI.LabelField(new Rect(rect.width - 10, rect.y, 40, EditorGUIUtility.singleLineHeight), "ToInt");
            EditorGUI.PropertyField(new Rect(rect.width - 25, rect.y, 10, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("IsInt"), GUIContent.none);
        }
        if (ShowType == GetBackType.Iamge)
        {
            EditorGUI.PropertyField(new Rect(rect.x + rect.width / 3.5f, rect.y, rect.width / 3.5f, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("ShowTexture"), GUIContent.none);
        }
        if (ShowType == GetBackType.AcitonEvent)
        {
            EditorGUI.PropertyField(new Rect(rect.x + rect.width / 3.5f, rect.y, rect.width / 6, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("EventObj"), GUIContent.none);
            EditorGUI.PropertyField(new Rect(rect.x + rect.width / 4 * 2, rect.y, rect.width / 6, EditorGUIUtility.singleLineHeight), element.FindPropertyRelative("EventName"), GUIContent.none);
        }
        //EditorGUI.PropertyField(rect, element, GUIContent.none);
    }