Esempio n. 1
0
    // Update is called once per frame
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        EditorGUI.BeginChangeCheck();

        TEXBoxHighlighting.DrawText(m_Text);

        if (serializedObject.targetObjects.Length == 1)
        {
            if (m_debugReport.stringValue != string.Empty)
            {
                EditorGUILayout.HelpBox(m_debugReport.stringValue, MessageType.Warning);
            }
        }

        EditorGUILayout.PropertyField(m_Size);
        //foldExpand = EditorGUILayout.Foldout(foldExpand, "More Properties");
        //if (foldExpand)
        {
            EditorGUI.indentLevel++;
            TEXSharedEditor.DoFontIndexSelection(m_FontIndex);
            EditorGUILayout.PropertyField(m_AutoFit);
            EditorGUI.BeginDisabledGroup(m_AutoFit.enumValueIndex == 2);
            EditorGUILayout.PropertyField(m_AutoWrap);
            EditorGUI.EndDisabledGroup();
            TEXSharedEditor.DoTextAligmentControl(EditorGUILayout.GetControlRect(), m_Align);
            EditorGUILayout.PropertyField(m_SpaceSize);
            EditorGUILayout.PropertyField(m_Color);
            //EditorGUILayout.PropertyField(m_Material);
            TEXSharedEditor.DoMaterialGUI(m_Material, (ITEXDraw)target);
            EditorGUILayout.PropertyField(m_Filling);
            EditorGUI.indentLevel--;
        }
        EditorGUILayout.PropertyField(m_raycastTarget);

        #if !UNITY_5_6_OR_NEWER
        HandleMaterialInspector();
        #endif

        if (EditorGUI.EndChangeCheck())
        {
            Redraw();
        }

        serializedObject.ApplyModifiedProperties();
    }
Esempio n. 2
0
    // Update is called once per frame
    public override void OnInspectorGUI()
    {
        serializedObject.Update();
        EditorGUI.BeginChangeCheck();

        TEXBoxHighlighting.DrawText(m_Text);

        if (serializedObject.targetObjects.Length == 1)
        {
            if (m_debugReport.stringValue != System.String.Empty)
            {
                EditorGUILayout.HelpBox(m_debugReport.stringValue, MessageType.Warning);
            }
        }

        EditorGUILayout.PropertyField(m_Size);
        {
            EditorGUI.indentLevel++;

            EditorGUILayout.PropertyField(m_FontSize);
            TEXSharedEditor.DoFontIndexSelection(m_FontIndex);
            TEXSharedEditor.DoTextAligmentControl(EditorGUILayout.GetControlRect(), m_Align);
            EditorGUILayout.PropertyField(m_SpaceSize);
            EditorGUILayout.PropertyField(m_Color);
            TEXSharedEditor.DoMaterialGUI(m_Material, (ITEXDraw)target);
            EditorGUILayout.PropertyField(m_Fitting);
            if (!m_Fitting.hasMultipleDifferentValues && m_Fitting.enumValueIndex > 0 && !((TEXDraw3D)target).GetComponent <RectTransform>())
            {
                EditorGUILayout.HelpBox("Fitting is useful when RectTransform is attached in this GameObject", MessageType.Info);
            }
            EditorGUILayout.PropertyField(m_Wrapping);
            EditorGUILayout.PropertyField(m_Filling);
            EditorGUI.indentLevel--;
        }

        serializedObject.ApplyModifiedProperties();

        if (EditorGUI.EndChangeCheck())
        {
            Redraw();
        }
    }