public void OnEnable()
 {
     m_editorWindow = this;
     UpdateEditorWindowSize(768f, 768f);
     TMP_UIStyleManager.GetUIStyles();
     ShaderUtilities.GetShaderPropertyIDs();
     TMPro_EventManager.COMPUTE_DT_EVENT.Add(ON_COMPUTE_DT_EVENT);
 }
Пример #2
0
 public void OnEnable()
 {
     Undo.undoRedoPerformed = (Undo.UndoRedoCallback)Delegate.Combine(Undo.undoRedoPerformed, new Undo.UndoRedoCallback(OnUndoRedo));
     text_prop                         = base.serializedObject.FindProperty("m_text");
     isRightToLeft_prop                = base.serializedObject.FindProperty("m_isRightToLeft");
     fontAsset_prop                    = base.serializedObject.FindProperty("m_fontAsset");
     fontSharedMaterial_prop           = base.serializedObject.FindProperty("m_sharedMaterial");
     fontStyle_prop                    = base.serializedObject.FindProperty("m_fontStyle");
     fontSize_prop                     = base.serializedObject.FindProperty("m_fontSize");
     fontSizeBase_prop                 = base.serializedObject.FindProperty("m_fontSizeBase");
     autoSizing_prop                   = base.serializedObject.FindProperty("m_enableAutoSizing");
     fontSizeMin_prop                  = base.serializedObject.FindProperty("m_fontSizeMin");
     fontSizeMax_prop                  = base.serializedObject.FindProperty("m_fontSizeMax");
     lineSpacingMax_prop               = base.serializedObject.FindProperty("m_lineSpacingMax");
     charWidthMaxAdj_prop              = base.serializedObject.FindProperty("m_charWidthMaxAdj");
     fontColor_prop                    = base.serializedObject.FindProperty("m_fontColor");
     enableVertexGradient_prop         = base.serializedObject.FindProperty("m_enableVertexGradient");
     fontColorGradient_prop            = base.serializedObject.FindProperty("m_fontColorGradient");
     fontColorGradientPreset_prop      = base.serializedObject.FindProperty("m_fontColorGradientPreset");
     overrideHtmlColor_prop            = base.serializedObject.FindProperty("m_overrideHtmlColors");
     characterSpacing_prop             = base.serializedObject.FindProperty("m_characterSpacing");
     wordSpacing_prop                  = base.serializedObject.FindProperty("m_wordSpacing");
     lineSpacing_prop                  = base.serializedObject.FindProperty("m_lineSpacing");
     paragraphSpacing_prop             = base.serializedObject.FindProperty("m_paragraphSpacing");
     textAlignment_prop                = base.serializedObject.FindProperty("m_textAlignment");
     horizontalMapping_prop            = base.serializedObject.FindProperty("m_horizontalMapping");
     verticalMapping_prop              = base.serializedObject.FindProperty("m_verticalMapping");
     uvLineOffset_prop                 = base.serializedObject.FindProperty("m_uvLineOffset");
     enableWordWrapping_prop           = base.serializedObject.FindProperty("m_enableWordWrapping");
     wordWrappingRatios_prop           = base.serializedObject.FindProperty("m_wordWrappingRatios");
     textOverflowMode_prop             = base.serializedObject.FindProperty("m_overflowMode");
     pageToDisplay_prop                = base.serializedObject.FindProperty("m_pageToDisplay");
     linkedTextComponent_prop          = base.serializedObject.FindProperty("m_linkedTextComponent");
     isLinkedTextComponent_prop        = base.serializedObject.FindProperty("m_isLinkedTextComponent");
     enableKerning_prop                = base.serializedObject.FindProperty("m_enableKerning");
     havePropertiesChanged_prop        = base.serializedObject.FindProperty("m_havePropertiesChanged");
     inputSource_prop                  = base.serializedObject.FindProperty("m_inputSource");
     isInputPasingRequired_prop        = base.serializedObject.FindProperty("m_isInputParsingRequired");
     enableExtraPadding_prop           = base.serializedObject.FindProperty("m_enableExtraPadding");
     isRichText_prop                   = base.serializedObject.FindProperty("m_isRichText");
     checkPaddingRequired_prop         = base.serializedObject.FindProperty("checkPaddingRequired");
     enableEscapeCharacterParsing_prop = base.serializedObject.FindProperty("m_parseCtrlCharacters");
     useMaxVisibleDescender_prop       = base.serializedObject.FindProperty("m_useMaxVisibleDescender");
     geometrySortingOrder_prop         = base.serializedObject.FindProperty("m_geometrySortingOrder");
     spriteAsset_prop                  = base.serializedObject.FindProperty("m_spriteAsset");
     raycastTarget_prop                = base.serializedObject.FindProperty("m_RaycastTarget");
     margin_prop                       = base.serializedObject.FindProperty("m_margin");
     hasFontAssetChanged_prop          = base.serializedObject.FindProperty("m_hasFontAssetChanged");
     TMP_UIStyleManager.GetUIStyles();
     m_textComponent  = (base.target as TextMeshProUGUI);
     m_rectTransform  = m_textComponent.rectTransform;
     m_targetMaterial = m_textComponent.fontSharedMaterial;
     if (m_foldout.materialEditor)
     {
         InternalEditorUtility.SetIsInspectorExpanded(m_targetMaterial, true);
     }
     m_materialPresetNames = GetMaterialPresets();
 }
Пример #3
0
        public void OnEnable()
        {
            m_spriteAtlas_prop    = serializedObject.FindProperty("spriteSheet");
            m_spriteInfoList_prop = serializedObject.FindProperty("spriteInfoList");


            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();
        }
Пример #4
0
 private void OnEnable()
 {
     anchorPosition_prop = base.serializedObject.FindProperty("m_anchorPosition");
     pivot_prop          = base.serializedObject.FindProperty("m_pivot");
     rectangle_prop      = base.serializedObject.FindProperty("m_rect");
     margins_prop        = base.serializedObject.FindProperty("m_margins");
     m_textContainer     = (TextContainer)(object)base.target;
     TMP_UIStyleManager.GetUIStyles();
 }
Пример #5
0
        public void OnEnable()
        {
            prop_FontAsset   = serializedObject.FindProperty("fontAsset");
            prop_SpriteAsset = serializedObject.FindProperty("spriteAsset");
            prop_StyleSheet  = serializedObject.FindProperty("styleSheet");


            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();
        }
Пример #6
0
        public void OnEnable()
        {
            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();


            m_SubMeshComponent = target as TMP_SubMesh;

            m_Renderer = m_SubMeshComponent.renderer;
        }
Пример #7
0
        void OnEnable()
        {
            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();

            topLeftColor     = serializedObject.FindProperty("topLeft");
            topRightColor    = serializedObject.FindProperty("topRight");
            bottomLeftColor  = serializedObject.FindProperty("bottomLeft");
            bottomRightColor = serializedObject.FindProperty("bottomRight");
        }
Пример #8
0
 private void PrepareGUI()
 {
     isNewGUI = false;
     TMP_UIStyleManager.GetUIStyles();
     ShaderUtilities.GetShaderPropertyIDs();
     if (lastSeenUndoRedoCount != undoRedoCount)
     {
         TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, material);
     }
     lastSeenUndoRedoCount = undoRedoCount;
 }
Пример #9
0
        void OnEnable()

        {
            // Get the UI Skin and Styles for the various Editors

            TMP_UIStyleManager.GetUIStyles();



            m_styleList_prop = serializedObject.FindProperty("m_StyleList");
        }
Пример #10
0
        public void OnEnable()
        {
            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();

            fontAsset_prop   = serializedObject.FindProperty("m_fontAsset");
            spriteAsset_prop = serializedObject.FindProperty("m_spriteAsset");

            m_SubMeshComponent = target as TMP_SubMesh;

            m_Renderer = m_SubMeshComponent.renderer;
        }
Пример #11
0
 public void OnEnable()
 {
     TMP_UIStyleManager.GetUIStyles();
     fontAsset_prop     = base.serializedObject.FindProperty("m_fontAsset");
     spriteAsset_prop   = base.serializedObject.FindProperty("m_spriteAsset");
     m_SubMeshComponent = (base.target as TMP_SubMeshUI);
     m_canvasRenderer   = m_SubMeshComponent.canvasRenderer;
     if (m_canvasRenderer != null && m_canvasRenderer.GetMaterial() != null)
     {
         m_materialEditor = Editor.CreateEditor(m_canvasRenderer.GetMaterial());
         m_targetMaterial = m_canvasRenderer.GetMaterial();
     }
 }
Пример #12
0
        public void OnEnable()
        {
            prop_FontAsset   = serializedObject.FindProperty("fontAsset");
            prop_SpriteAsset = serializedObject.FindProperty("spriteAsset");
            prop_StyleSheet  = serializedObject.FindProperty("styleSheet");

            prop_WordWrapping = serializedObject.FindProperty("enableWordWrapping");
            prop_Kerning      = serializedObject.FindProperty("enableKerning");
            prop_ExtraPadding = serializedObject.FindProperty("enableExtraPadding");

            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();
        }
Пример #13
0
 void PrepareGUI()
 {
     isNewGUI = false;
     TMP_UIStyleManager.GetUIStyles();
     ShaderUtilities.GetShaderPropertyIDs();
     // New GUI just got constructed. This happens in response to a selection,
     // but also after undo/redo events.
     if (lastSeenUndoRedoCount != undoRedoCount)
     {
         // There's been at least one undo/redo since the last time this GUI got constructed.
         // Maybe the undo/redo was for this material? Assume that is was.
         TMPro_EventManager.ON_MATERIAL_PROPERTY_CHANGED(true, material as Material);
     }
     lastSeenUndoRedoCount = undoRedoCount;
 }
Пример #14
0
        public void OnEnable()
        {
            prop_FontAsset                             = serializedObject.FindProperty("m_defaultFontAsset");
            prop_DefaultFontAssetPath                  = serializedObject.FindProperty("m_defaultFontAssetPath");
            prop_DefaultFontSize                       = serializedObject.FindProperty("m_defaultFontSize");
            prop_DefaultAutoSizeMinRatio               = serializedObject.FindProperty("m_defaultAutoSizeMinRatio");
            prop_DefaultAutoSizeMaxRatio               = serializedObject.FindProperty("m_defaultAutoSizeMaxRatio");
            prop_DefaultTextMeshProTextContainerSize   = serializedObject.FindProperty("m_defaultTextMeshProTextContainerSize");
            prop_DefaultTextMeshProUITextContainerSize = serializedObject.FindProperty("m_defaultTextMeshProUITextContainerSize");
            prop_AutoSizeTextContainer                 = serializedObject.FindProperty("m_autoSizeTextContainer");

            prop_SpriteAsset              = serializedObject.FindProperty("m_defaultSpriteAsset");
            prop_SpriteAssetPath          = serializedObject.FindProperty("m_defaultSpriteAssetPath");
            prop_EnableEmojiSupport       = serializedObject.FindProperty("m_enableEmojiSupport");
            prop_StyleSheet               = serializedObject.FindProperty("m_defaultStyleSheet");
            prop_ColorGradientPresetsPath = serializedObject.FindProperty("m_defaultColorGradientPresetsPath");

            m_list = new ReorderableList(serializedObject, serializedObject.FindProperty("m_fallbackFontAssets"), true, true, true, true);

            m_list.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
            {
                var element = m_list.serializedProperty.GetArrayElementAtIndex(index);
                rect.y += 2;
                EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width, EditorGUIUtility.singleLineHeight), element, GUIContent.none);
            };

            m_list.drawHeaderCallback = rect =>
            {
                EditorGUI.LabelField(rect, "<b>Fallback Font Asset List</b>", TMP_UIStyleManager.Label);
            };

            prop_matchMaterialPreset = serializedObject.FindProperty("m_matchMaterialPreset");

            prop_WordWrapping          = serializedObject.FindProperty("m_enableWordWrapping");
            prop_Kerning               = serializedObject.FindProperty("m_enableKerning");
            prop_ExtraPadding          = serializedObject.FindProperty("m_enableExtraPadding");
            prop_TintAllSprites        = serializedObject.FindProperty("m_enableTintAllSprites");
            prop_ParseEscapeCharacters = serializedObject.FindProperty("m_enableParseEscapeCharacters");
            prop_MissingGlyphCharacter = serializedObject.FindProperty("m_missingGlyphCharacter");

            prop_WarningsDisabled = serializedObject.FindProperty("m_warningsDisabled");

            prop_LeadingCharacters   = serializedObject.FindProperty("m_leadingCharacters");
            prop_FollowingCharacters = serializedObject.FindProperty("m_followingCharacters");

            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();
        }
        public void OnEnable()
        {
            m_editorWindow = this;
            UpdateEditorWindowSize(768, 768);


            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();


            // Locate the plugin files & move them to root of project if that hasn't already been done.
#if !UNITY_5
            // Find to location of the TextMesh Pro Asset Folder (as users may have moved it)
            string tmproAssetFolderPath = TMPro_EditorUtility.GetAssetLocation();

            string projectPath = Path.GetFullPath("Assets/..");

            if (System.IO.File.Exists(projectPath + "/TMPro_Plugin.dll") == false)
            {
                FileUtil.ReplaceFile(tmproAssetFolderPath + "/Plugins/TMPro_Plugin.dll", projectPath + "/TMPro_Plugin.dll");     // Copy the .dll
                FileUtil.ReplaceFile(tmproAssetFolderPath + "/Plugins/TMPro_Plugin.dylib", projectPath + "/TMPro_Plugin.dylib"); // Copy Mac .dylib
                FileUtil.ReplaceFile(tmproAssetFolderPath + "/Plugins/vcomp120.dll", projectPath + "/vcomp120.dll");             // Copy OpemMP .dll
            }
            else // Check if we are using the latest versions
            {
                if (System.IO.File.GetLastWriteTime(tmproAssetFolderPath + "/Plugins/TMPro_Plugin.dylib") > System.IO.File.GetLastWriteTime(projectPath + "/TMPro_Plugin.dylib"))
                {
                    FileUtil.ReplaceFile(tmproAssetFolderPath + "/Plugins/TMPro_Plugin.dylib", projectPath + "/TMPro_Plugin.dylib");
                }

                if (System.IO.File.GetLastWriteTime(tmproAssetFolderPath + "/Plugins/TMPro_Plugin.dll") > System.IO.File.GetLastWriteTime(projectPath + "/TMPro_Plugin.dll"))
                {
                    FileUtil.ReplaceFile(tmproAssetFolderPath + "/Plugins/TMPro_Plugin.dll", projectPath + "/TMPro_Plugin.dll");
                }

                if (System.IO.File.GetLastWriteTime(tmproAssetFolderPath + "/Plugins/vcomp120.dll") > System.IO.File.GetLastWriteTime(projectPath + "/vcomp120.dll"))
                {
                    FileUtil.ReplaceFile(tmproAssetFolderPath + "/Plugins/vcomp120.dll", projectPath + "/vcomp120.dll");
                }
            }
#endif

            // Add Event Listener related to Distance Field Atlas Creation.
            TMPro_EventManager.COMPUTE_DT_EVENT += ON_COMPUTE_DT_EVENT;

            // Debug Link to received message from Native Code
            //TMPro_FontPlugin.LinkDebugLog(); // Link with C++ Plugin to get Debug output
        }
        public void OnEnable()
        {
            font_atlas_prop    = serializedObject.FindProperty("atlas");
            font_material_prop = serializedObject.FindProperty("material");

            fontWeights_prop = serializedObject.FindProperty("fontWeights");

            m_list = new ReorderableList(serializedObject, serializedObject.FindProperty("fallbackFontAssets"), true, true, true, true);

            m_list.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
            {
                var element = m_list.serializedProperty.GetArrayElementAtIndex(index);
                rect.y += 2;
                EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width, EditorGUIUtility.singleLineHeight), element, GUIContent.none);
            };

            m_list.drawHeaderCallback = rect =>
            {
                EditorGUI.LabelField(rect, "<b>Fallback Font Asset List</b>", TMP_UIStyleManager.Label);
            };

            font_normalStyle_prop   = serializedObject.FindProperty("normalStyle");
            font_normalSpacing_prop = serializedObject.FindProperty("normalSpacingOffset");

            font_boldStyle_prop   = serializedObject.FindProperty("boldStyle");
            font_boldSpacing_prop = serializedObject.FindProperty("boldSpacing");

            font_italicStyle_prop = serializedObject.FindProperty("italicStyle");
            font_tabSize_prop     = serializedObject.FindProperty("tabSize");

            m_fontInfo_prop      = serializedObject.FindProperty("m_fontInfo");
            m_glyphInfoList_prop = serializedObject.FindProperty("m_glyphInfoList");
            m_kerningInfo_prop   = serializedObject.FindProperty("m_kerningInfo");
            m_kerningPair_prop   = serializedObject.FindProperty("m_kerningPair");
            m_kerningPairs_prop  = m_kerningInfo_prop.FindPropertyRelative("kerningPairs");

            m_fontAsset    = target as TMP_FontAsset;
            m_kerningTable = m_fontAsset.kerningInfo;

            m_materialPresets = TMP_EditorUtility.FindMaterialReferences(m_fontAsset);

            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();

            m_GlyphSearchList        = new List <int>();
            m_KerningTableSearchList = new List <int>();
        }
Пример #17
0
        protected override void OnEnable()
        {
            base.OnEnable();

            m_TextViewport        = serializedObject.FindProperty("m_TextViewport");
            m_TextComponent       = serializedObject.FindProperty("m_TextComponent");
            m_Text                = serializedObject.FindProperty("m_Text");
            m_ContentType         = serializedObject.FindProperty("m_ContentType");
            m_LineType            = serializedObject.FindProperty("m_LineType");
            m_InputType           = serializedObject.FindProperty("m_InputType");
            m_CharacterValidation = serializedObject.FindProperty("m_CharacterValidation");
            m_InputValidator      = serializedObject.FindProperty("m_InputValidator");
            m_RegexValue          = serializedObject.FindProperty("m_RegexValue");
            m_KeyboardType        = serializedObject.FindProperty("m_KeyboardType");
            m_CharacterLimit      = serializedObject.FindProperty("m_CharacterLimit");
            m_CaretBlinkRate      = serializedObject.FindProperty("m_CaretBlinkRate");
            m_CaretWidth          = serializedObject.FindProperty("m_CaretWidth");
            m_CaretColor          = serializedObject.FindProperty("m_CaretColor");
            m_CustomCaretColor    = serializedObject.FindProperty("m_CustomCaretColor");
            m_SelectionColor      = serializedObject.FindProperty("m_SelectionColor");
            m_HideMobileInput     = serializedObject.FindProperty("m_HideMobileInput");

            m_Placeholder                = serializedObject.FindProperty("m_Placeholder");
            m_VerticalScrollbar          = serializedObject.FindProperty("m_VerticalScrollbar");
            m_ScrollbarScrollSensitivity = serializedObject.FindProperty("m_ScrollSensitivity");

            m_OnValueChanged              = serializedObject.FindProperty("m_OnValueChanged");
            m_OnEndEdit                   = serializedObject.FindProperty("m_OnEndEdit");
            m_OnSelect                    = serializedObject.FindProperty("m_OnSelect");
            m_OnDeselect                  = serializedObject.FindProperty("m_OnDeselect");
            m_ReadOnly                    = serializedObject.FindProperty("m_ReadOnly");
            m_RichText                    = serializedObject.FindProperty("m_RichText");
            m_RichTextEditingAllowed      = serializedObject.FindProperty("m_isRichTextEditingAllowed");
            m_ResetOnDeActivation         = serializedObject.FindProperty("m_ResetOnDeActivation");
            m_RestoreOriginalTextOnEscape = serializedObject.FindProperty("m_RestoreOriginalTextOnEscape");

            m_OnFocusSelectAll = serializedObject.FindProperty("m_OnFocusSelectAll");
            m_GlobalPointSize  = serializedObject.FindProperty("m_GlobalPointSize");
            m_GlobalFontAsset  = serializedObject.FindProperty("m_GlobalFontAsset");

            m_CustomColor = new AnimBool(m_CustomCaretColor.boolValue);
            m_CustomColor.valueChanged.AddListener(Repaint);

            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();
        }
Пример #18
0
        public void OnEnable()
        {
            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();

            m_SubMeshComponent = target as TMP_SubMeshUI;
            //m_rectTransform = m_SubMeshComponent.rectTransform;
            m_canvasRenderer = m_SubMeshComponent.canvasRenderer;


            // Create new Material Editor if one does not exists
            if (m_canvasRenderer != null && m_canvasRenderer.GetMaterial() != null)
            {
                m_materialEditor = Editor.CreateEditor(m_canvasRenderer.GetMaterial());
                m_targetMaterial = m_canvasRenderer.GetMaterial();
            }
        }
Пример #19
0
 public void OnEnable()
 {
     m_spriteAtlas_prop        = base.serializedObject.FindProperty("spriteSheet");
     m_material_prop           = base.serializedObject.FindProperty("material");
     m_spriteInfoList_prop     = base.serializedObject.FindProperty("spriteInfoList");
     m_fallbackSpriteAssetList = new ReorderableList(base.serializedObject, base.serializedObject.FindProperty("fallbackSpriteAssets"), true, true, true, true);
     m_fallbackSpriteAssetList.drawElementCallback = delegate(Rect rect, int index, bool isActive, bool isFocused)
     {
         SerializedProperty arrayElementAtIndex = m_fallbackSpriteAssetList.serializedProperty.GetArrayElementAtIndex(index);
         rect.y += 2f;
         EditorGUI.PropertyField(new Rect(rect.x, rect.y, rect.width, EditorGUIUtility.singleLineHeight), arrayElementAtIndex, GUIContent.none);
     };
     m_fallbackSpriteAssetList.drawHeaderCallback = delegate(Rect rect)
     {
         EditorGUI.LabelField(rect, "<b>Fallback Sprite Asset List</b>", TMP_UIStyleManager.Label);
     };
     TMP_UIStyleManager.GetUIStyles();
 }
        //private Vector2 m_anchorPosition;



        //private Vector3 m_mousePreviousPOS;

        //private Vector2 m_previousStartPOS;

        //private int m_mouseDragFlag = 0;



        //private static Transform m_visualHelper;



        void OnEnable()

        {
            // Serialized Properties

            anchorPosition_prop = serializedObject.FindProperty("m_anchorPosition");

            pivot_prop = serializedObject.FindProperty("m_pivot");

            rectangle_prop = serializedObject.FindProperty("m_rect");

            margins_prop = serializedObject.FindProperty("m_margins");



            m_textContainer = (TextContainer)target;

            m_transform = m_textContainer.transform;



            // Get the UI Skin and Styles for the various Editors

            TMP_UIStyleManager.GetUIStyles();



            /*
             *
             * if (m_visualHelper == null)
             *
             * {
             *
             *  m_visualHelper = GameObject.CreatePrimitive(PrimitiveType.Sphere).transform;
             *
             *  m_visualHelper.localScale = new Vector3(0.25f, 0.25f, 0.25f);
             *
             * }
             *
             */
        }
Пример #21
0
        public void OnEnable()
        {
            font_atlas_prop    = serializedObject.FindProperty("atlas");
            font_material_prop = serializedObject.FindProperty("material");

            fontWeights_prop = serializedObject.FindProperty("fontWeights");

            //fontWeight_Thin = serializedObject.FindProperty("thin");
            //fontWeight_ExtraLight = serializedObject.FindProperty("extraLight");
            //fontWeight_Light = serializedObject.FindProperty("light");
            //fontWeight_Normal = serializedObject.FindProperty("normal");
            //fontWeight_Medium = serializedObject.FindProperty("medium");
            //fontWeight_DemiBold = serializedObject.FindProperty("demiBold");
            //fontWeight_Bold = serializedObject.FindProperty("bold");
            //fontWeight_Heavy = serializedObject.FindProperty("heavy");
            //fontWeight_Black = serializedObject.FindProperty("black");

            font_normalStyle_prop   = serializedObject.FindProperty("normalStyle");
            font_normalSpacing_prop = serializedObject.FindProperty("normalSpacingOffset");

            font_boldStyle_prop   = serializedObject.FindProperty("boldStyle");
            font_boldSpacing_prop = serializedObject.FindProperty("boldSpacing");

            font_italicStyle_prop = serializedObject.FindProperty("italicStyle");
            font_tabSize_prop     = serializedObject.FindProperty("tabSize");

            m_fontInfo_prop      = serializedObject.FindProperty("m_fontInfo");
            m_glyphInfoList_prop = serializedObject.FindProperty("m_glyphInfoList");
            m_kerningInfo_prop   = serializedObject.FindProperty("m_kerningInfo");
            m_kerningPair_prop   = serializedObject.FindProperty("m_kerningPair");

            //m_isGlyphInfoListExpanded_prop = serializedObject.FindProperty("isGlyphInfoListExpanded");
            //m_isKerningTableExpanded_prop = serializedObject.FindProperty("isKerningTableExpanded");

            m_fontAsset    = target as TMP_FontAsset;
            m_kerningTable = m_fontAsset.kerningInfo;

            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();
        }
Пример #22
0
        public void OnEnable()
        {
            font_atlas_prop       = serializedObject.FindProperty("atlas");
            font_material_prop    = serializedObject.FindProperty("material");
            font_normalStyle_prop = serializedObject.FindProperty("NormalStyle");
            font_boldStyle_prop   = serializedObject.FindProperty("BoldStyle");
            font_italicStyle_prop = serializedObject.FindProperty("ItalicStyle");
            font_tabSize_prop     = serializedObject.FindProperty("TabSize");

            m_fontInfo_prop      = serializedObject.FindProperty("m_fontInfo");
            m_glyphInfoList_prop = serializedObject.FindProperty("m_glyphInfoList");
            m_kerningInfo_prop   = serializedObject.FindProperty("m_kerningInfo");
            m_kerningPair_prop   = serializedObject.FindProperty("m_kerningPair");

            //m_isGlyphInfoListExpanded_prop = serializedObject.FindProperty("isGlyphInfoListExpanded");
            //m_isKerningTableExpanded_prop = serializedObject.FindProperty("isKerningTableExpanded");

            m_fontAsset    = target as TextMeshProFont;
            m_kerningTable = m_fontAsset.kerningInfo;

            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();
        }
Пример #23
0
 private void OnEnable()
 {
     TMP_UIStyleManager.GetUIStyles();
     m_styleList_prop = base.serializedObject.FindProperty("m_StyleList");
 }
Пример #24
0
        private Vector3[] handlePoints = new Vector3[4]; // { new Vector3(-10, -10, 0), new Vector3(-10, 10, 0), new Vector3(10, 10, 0), new Vector3(10, -10, 0) };
        //private float prev_lineLenght;

        //private bool m_isUndoSet;

        public void OnEnable()
        {
            //Debug.Log("New Instance of TMPRO UGUI Editor with ID " + this.GetInstanceID());

            // Initialize the Event Listener for Undo Events.
            Undo.undoRedoPerformed += OnUndoRedo;
            //Undo.postprocessModifications += OnUndoRedoEvent;

            text_prop          = serializedObject.FindProperty("m_text");
            isRightToLeft_prop = serializedObject.FindProperty("m_isRightToLeft");
            fontAsset_prop     = serializedObject.FindProperty("m_fontAsset");
            //fontSharedMaterial_prop = serializedObject.FindProperty("m_sharedMaterial");
            //fontBaseMaterial_prop = serializedObject.FindProperty("m_baseMaterial");
            //isNewBaseMaterial_prop = serializedObject.FindProperty("m_isNewBaseMaterial");

            fontStyle_prop = serializedObject.FindProperty("m_fontStyle");

            fontSize_prop     = serializedObject.FindProperty("m_fontSize");
            fontSizeBase_prop = serializedObject.FindProperty("m_fontSizeBase");

            autoSizing_prop  = serializedObject.FindProperty("m_enableAutoSizing");
            fontSizeMin_prop = serializedObject.FindProperty("m_fontSizeMin");
            fontSizeMax_prop = serializedObject.FindProperty("m_fontSizeMax");
            //charSpacingMax_prop = serializedObject.FindProperty("m_charSpacingMax");
            lineSpacingMax_prop  = serializedObject.FindProperty("m_lineSpacingMax");
            charWidthMaxAdj_prop = serializedObject.FindProperty("m_charWidthMaxAdj");

            // Colors & Gradient
            fontColor_prop            = serializedObject.FindProperty("m_fontColor");
            enableVertexGradient_prop = serializedObject.FindProperty("m_enableVertexGradient");
            fontColorGradient_prop    = serializedObject.FindProperty("m_fontColorGradient");
            overrideHtmlColor_prop    = serializedObject.FindProperty("m_overrideHtmlColors");

            characterSpacing_prop = serializedObject.FindProperty("m_characterSpacing");
            lineSpacing_prop      = serializedObject.FindProperty("m_lineSpacing");
            paragraphSpacing_prop = serializedObject.FindProperty("m_paragraphSpacing");

            textAlignment_prop = serializedObject.FindProperty("m_textAlignment");

            enableWordWrapping_prop = serializedObject.FindProperty("m_enableWordWrapping");
            wordWrappingRatios_prop = serializedObject.FindProperty("m_wordWrappingRatios");
            textOverflowMode_prop   = serializedObject.FindProperty("m_overflowMode");
            pageToDisplay_prop      = serializedObject.FindProperty("m_pageToDisplay");

            horizontalMapping_prop = serializedObject.FindProperty("m_horizontalMapping");
            verticalMapping_prop   = serializedObject.FindProperty("m_verticalMapping");
            uvOffset_prop          = serializedObject.FindProperty("m_uvOffset");
            uvLineOffset_prop      = serializedObject.FindProperty("m_uvLineOffset");

            enableKerning_prop = serializedObject.FindProperty("m_enableKerning");


            //isOrthographic_prop = serializedObject.FindProperty("m_isOrthographic");

            havePropertiesChanged_prop = serializedObject.FindProperty("m_havePropertiesChanged");
            inputSource_prop           = serializedObject.FindProperty("m_inputSource");
            isInputPasingRequired_prop = serializedObject.FindProperty("m_isInputParsingRequired");
            //isCalculateSizeRequired_prop = serializedObject.FindProperty("m_isCalculateSizeRequired");
            enableExtraPadding_prop   = serializedObject.FindProperty("m_enableExtraPadding");
            isRichText_prop           = serializedObject.FindProperty("m_isRichText");
            checkPaddingRequired_prop = serializedObject.FindProperty("checkPaddingRequired");
            raycastTarget_prop        = serializedObject.FindProperty("m_RaycastTarget");


            margin_prop = serializedObject.FindProperty("m_margin");

            //isMaskUpdateRequired_prop = serializedObject.FindProperty("isMaskUpdateRequired");
            //mask_prop = serializedObject.FindProperty("m_mask");
            //maskOffset_prop= serializedObject.FindProperty("m_maskOffset");
            //maskOffsetMode_prop = serializedObject.FindProperty("m_maskOffsetMode");
            //maskSoftness_prop = serializedObject.FindProperty("m_maskSoftness");
            //vertexOffset_prop = serializedObject.FindProperty("m_vertexOffset");

            //sortingLayerID_prop = serializedObject.FindProperty("m_sortingLayerID");
            //sortingOrder_prop = serializedObject.FindProperty("m_sortingOrder");

            hasFontAssetChanged_prop = serializedObject.FindProperty("m_hasFontAssetChanged");

            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();

            m_textComponent = target as TextMeshProUGUI;
            m_rectTransform = m_textComponent.rectTransform;
            //m_canvasRenderer = m_textComponent.canvasRenderer;


            // Create new Material Editor if one does not exists
            m_targetMaterial = m_textComponent.fontSharedMaterial;
            if (m_targetMaterial != null)
            {
                m_materialEditor = Editor.CreateEditor(m_targetMaterial);
            }
        }
Пример #25
0
        private Vector3[] handlePoints = new Vector3[4]; // { new Vector3(-10, -10, 0), new Vector3(-10, 10, 0), new Vector3(10, 10, 0), new Vector3(10, -10, 0) };
        //private float prev_lineLenght;

        //private bool m_isUndoSet;

        public void OnEnable()
        {
            //Debug.Log("New Instance of TMPRO UGUI Editor with ID " + this.GetInstanceID());

            // Initialize the Event Listener for Undo Events.
            Undo.undoRedoPerformed += OnUndoRedo;
            //Undo.postprocessModifications += OnUndoRedoEvent;

            text_prop               = serializedObject.FindProperty("m_text");
            fontAsset_prop          = serializedObject.FindProperty("m_fontAsset");
            fontSharedMaterial_prop = serializedObject.FindProperty("m_sharedMaterial");
            //fontBaseMaterial_prop = serializedObject.FindProperty("m_baseMaterial");
            isNewBaseMaterial_prop = serializedObject.FindProperty("m_isNewBaseMaterial");

            fontStyle_prop = serializedObject.FindProperty("m_fontStyle");

            fontSize_prop     = serializedObject.FindProperty("m_fontSize");
            fontSizeBase_prop = serializedObject.FindProperty("m_fontSizeBase");

            autoSizing_prop  = serializedObject.FindProperty("m_enableAutoSizing");
            fontSizeMin_prop = serializedObject.FindProperty("m_fontSizeMin");
            fontSizeMax_prop = serializedObject.FindProperty("m_fontSizeMax");
            //charSpacingMax_prop = serializedObject.FindProperty("m_charSpacingMax");
            lineSpacingMax_prop  = serializedObject.FindProperty("m_lineSpacingMax");
            charWidthMaxAdj_prop = serializedObject.FindProperty("m_charWidthMaxAdj");

            // Colors & Gradient
            fontColor_prop            = serializedObject.FindProperty("m_fontColor");
            enableVertexGradient_prop = serializedObject.FindProperty("m_enableVertexGradient");
            fontColorGradient_prop    = serializedObject.FindProperty("m_fontColorGradient");
            overrideHtmlColor_prop    = serializedObject.FindProperty("m_overrideHtmlColors");

            characterSpacing_prop = serializedObject.FindProperty("m_characterSpacing");
            lineSpacing_prop      = serializedObject.FindProperty("m_lineSpacing");
            paragraphSpacing_prop = serializedObject.FindProperty("m_paragraphSpacing");

            textAlignment_prop = serializedObject.FindProperty("m_textAlignment");

            enableWordWrapping_prop = serializedObject.FindProperty("m_enableWordWrapping");
            wordWrappingRatios_prop = serializedObject.FindProperty("m_wordWrappingRatios");
            textOverflowMode_prop   = serializedObject.FindProperty("m_overflowMode");
            pageToDisplay_prop      = serializedObject.FindProperty("m_pageToDisplay");

            horizontalMapping_prop = serializedObject.FindProperty("m_horizontalMapping");
            verticalMapping_prop   = serializedObject.FindProperty("m_verticalMapping");
            uvOffset_prop          = serializedObject.FindProperty("m_uvOffset");
            uvLineOffset_prop      = serializedObject.FindProperty("m_uvLineOffset");

            enableKerning_prop = serializedObject.FindProperty("m_enableKerning");


            //isOrthographic_prop = serializedObject.FindProperty("m_isOrthographic");

            havePropertiesChanged_prop = serializedObject.FindProperty("m_havePropertiesChanged");
            inputSource_prop           = serializedObject.FindProperty("m_inputSource");
            isInputPasingRequired_prop = serializedObject.FindProperty("isInputParsingRequired");
            //isCalculateSizeRequired_prop = serializedObject.FindProperty("m_isCalculateSizeRequired");
            enableExtraPadding_prop   = serializedObject.FindProperty("m_enableExtraPadding");
            isRichText_prop           = serializedObject.FindProperty("m_isRichText");
            checkPaddingRequired_prop = serializedObject.FindProperty("checkPaddingRequired");
            raycastTarget_prop        = serializedObject.FindProperty("m_RaycastTarget");


            margin_prop = serializedObject.FindProperty("m_margin");

            //isMaskUpdateRequired_prop = serializedObject.FindProperty("isMaskUpdateRequired");
            //mask_prop = serializedObject.FindProperty("m_mask");
            //maskOffset_prop= serializedObject.FindProperty("m_maskOffset");
            //maskOffsetMode_prop = serializedObject.FindProperty("m_maskOffsetMode");
            //maskSoftness_prop = serializedObject.FindProperty("m_maskSoftness");
            //vertexOffset_prop = serializedObject.FindProperty("m_vertexOffset");

            //sortingLayerID_prop = serializedObject.FindProperty("m_sortingLayerID");
            //sortingOrder_prop = serializedObject.FindProperty("m_sortingOrder");

            hasFontAssetChanged_prop = serializedObject.FindProperty("hasFontAssetChanged");

            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();


            m_textMeshProScript = (TextMeshProUGUI)target;
            m_rectTransform     = Selection.activeGameObject.GetComponent <RectTransform>();
            m_uiRenderer        = Selection.activeGameObject.GetComponent <CanvasRenderer>();

            // Add a Material Component if one does not exists

            /*
             * m_materialComponent = Selection.activeGameObject.GetComponent<MaterialComponent> ();
             * if (m_materialComponent == null)
             * {
             *  m_materialComponent = Selection.activeGameObject.AddComponent<MaterialComponent> ();
             * }
             */

            // Create new Material Editor if one does not exists
            if (m_uiRenderer != null && m_uiRenderer.GetMaterial() != null)
            {
                m_materialEditor = Editor.CreateEditor(m_uiRenderer.GetMaterial());
                m_targetMaterial = m_uiRenderer.GetMaterial();

                //UnityEditorInternal.InternalEditorUtility.SetIsInspectorExpanded(m_targetMaterial, true);
                //Debug.Log("Currently Assigned Material is " + m_targetMaterial + ".  Font Material is " + m_textMeshProScript.fontSharedMaterial);
            }

            //m_updateManager = Camera.main.gameObject.GetComponent<TMPro_UpdateManager>();
        }
Пример #26
0
        public void OnEnable()
        {
            //Debug.Log("OnEnable() for Inspector ID " + this.GetInstanceID() + " has been called.");

            // Initialize the Event Listener for Undo Events.
            Undo.undoRedoPerformed += OnUndoRedo;
            //Undo.postprocessModifications += OnUndoRedoEvent;

            text_prop          = serializedObject.FindProperty("m_text");
            isRightToLeft_prop = serializedObject.FindProperty("m_isRightToLeft");
            fontAsset_prop     = serializedObject.FindProperty("m_fontAsset");

            fontStyle_prop = serializedObject.FindProperty("m_fontStyle");

            fontSize_prop     = serializedObject.FindProperty("m_fontSize");
            fontSizeBase_prop = serializedObject.FindProperty("m_fontSizeBase");

            autoSizing_prop  = serializedObject.FindProperty("m_enableAutoSizing");
            fontSizeMin_prop = serializedObject.FindProperty("m_fontSizeMin");
            fontSizeMax_prop = serializedObject.FindProperty("m_fontSizeMax");
            //charSpacingMax_prop = serializedObject.FindProperty("m_charSpacingMax");
            lineSpacingMax_prop  = serializedObject.FindProperty("m_lineSpacingMax");
            charWidthMaxAdj_prop = serializedObject.FindProperty("m_charWidthMaxAdj");

            // Colors & Gradient
            fontColor_prop            = serializedObject.FindProperty("m_fontColor");
            enableVertexGradient_prop = serializedObject.FindProperty("m_enableVertexGradient");
            fontColorGradient_prop    = serializedObject.FindProperty("m_fontColorGradient");
            overrideHtmlColor_prop    = serializedObject.FindProperty("m_overrideHtmlColors");

            characterSpacing_prop = serializedObject.FindProperty("m_characterSpacing");
            lineSpacing_prop      = serializedObject.FindProperty("m_lineSpacing");
            paragraphSpacing_prop = serializedObject.FindProperty("m_paragraphSpacing");

            textAlignment_prop = serializedObject.FindProperty("m_textAlignment");

            horizontalMapping_prop = serializedObject.FindProperty("m_horizontalMapping");
            verticalMapping_prop   = serializedObject.FindProperty("m_verticalMapping");
            uvOffset_prop          = serializedObject.FindProperty("m_uvOffset");
            uvLineOffset_prop      = serializedObject.FindProperty("m_uvLineOffset");

            enableWordWrapping_prop = serializedObject.FindProperty("m_enableWordWrapping");
            wordWrappingRatios_prop = serializedObject.FindProperty("m_wordWrappingRatios");
            textOverflowMode_prop   = serializedObject.FindProperty("m_overflowMode");
            pageToDisplay_prop      = serializedObject.FindProperty("m_pageToDisplay");

            enableKerning_prop  = serializedObject.FindProperty("m_enableKerning");
            isOrthographic_prop = serializedObject.FindProperty("m_isOrthographic");
            //isOverlay_prop = serializedObject.FindProperty("m_isOverlay");

            havePropertiesChanged_prop = serializedObject.FindProperty("havePropertiesChanged");
            inputSource_prop           = serializedObject.FindProperty("m_inputSource");
            isInputPasingRequired_prop = serializedObject.FindProperty("isInputParsingRequired");
            //isAffectingWordWrapping_prop = serializedObject.FindProperty("isAffectingWordWrapping");
            enableExtraPadding_prop   = serializedObject.FindProperty("m_enableExtraPadding");
            isRichText_prop           = serializedObject.FindProperty("m_isRichText");
            checkPaddingRequired_prop = serializedObject.FindProperty("checkPaddingRequired");

            //isMaskUpdateRequired_prop = serializedObject.FindProperty("isMaskUpdateRequired");
            //mask_prop = serializedObject.FindProperty("m_mask");
            //maskOffset_prop= serializedObject.FindProperty("m_maskOffset");
            //maskOffsetMode_prop = serializedObject.FindProperty("m_maskOffsetMode");
            //maskSoftness_prop = serializedObject.FindProperty("m_maskSoftness");
            //vertexOffset_prop = serializedObject.FindProperty("m_vertexOffset");

            //m_sortingLayerID = serializedObject.FindProperty("m_sortingLayerID");
            //m_sortingOrder = serializedObject.FindProperty("m_sortingOrder");

            hasFontAssetChanged_prop = serializedObject.FindProperty("hasFontAssetChanged");

            //renderer_prop = serializedObject.FindProperty("m_renderer");

            // Get the UI Skin and Styles for the various Editors
            TMP_UIStyleManager.GetUIStyles();

            m_textMeshProScript = target as TextMeshPro;
            //m_transform = Selection.activeGameObject.transform;
            m_renderer = m_textMeshProScript.GetComponent <Renderer>();
            //m_sortingLayerID = m_renderer.sortingLayerID;
            //m_sortingOrder = m_renderer.sortingOrder;
            //if (m_renderer.sharedMaterial != null)
            //    m_currentMaterial = m_renderer.sharedMaterial;

            //m_updateManager = Camera.main.gameObject.GetComponent<TMPro_UpdateManager>();
        }
Пример #27
0
        protected override void OnEnable()

        {
            base.OnEnable();



            m_TextViewport = serializedObject.FindProperty("m_TextViewport");

            m_TextComponent = serializedObject.FindProperty("m_TextComponent");

            m_Text = serializedObject.FindProperty("m_Text");

            m_ContentType = serializedObject.FindProperty("m_ContentType");

            m_LineType = serializedObject.FindProperty("m_LineType");

            m_InputType = serializedObject.FindProperty("m_InputType");

            m_CharacterValidation = serializedObject.FindProperty("m_CharacterValidation");

            m_KeyboardType = serializedObject.FindProperty("m_KeyboardType");

            m_CharacterLimit = serializedObject.FindProperty("m_CharacterLimit");

            m_CaretBlinkRate = serializedObject.FindProperty("m_CaretBlinkRate");

            m_CaretWidth = serializedObject.FindProperty("m_CaretWidth");

            m_CaretColor = serializedObject.FindProperty("m_CaretColor");

            m_CustomCaretColor = serializedObject.FindProperty("m_CustomCaretColor");

            m_SelectionColor = serializedObject.FindProperty("m_SelectionColor");

            m_HideMobileInput = serializedObject.FindProperty("m_HideMobileInput");

            m_Placeholder = serializedObject.FindProperty("m_Placeholder");

            m_OnValueChanged = serializedObject.FindProperty("m_OnValueChanged");

            m_OnEndEdit = serializedObject.FindProperty("m_OnEndEdit");

            m_OnFocusLost = serializedObject.FindProperty("m_OnFocusLost");

            m_ReadOnly = serializedObject.FindProperty("m_ReadOnly");

            m_RichText = serializedObject.FindProperty("m_RichText");



            m_CustomColor = new AnimBool(m_CustomCaretColor.boolValue);

            m_CustomColor.valueChanged.AddListener(Repaint);



            // Get the UI Skin and Styles for the various Editors

            TMP_UIStyleManager.GetUIStyles();
        }