示例#1
0
        //public TMP_Style()
        //{
        //Debug.Log("New Style with Name: " + m_Name + " was created. ID: ");
        //}


        /// <summary>
        /// Function to update the content of the int[] resulting from changes to OpeningDefinition & ClosingDefinition.
        /// </summary>
        public void RefreshStyle()
        {
            m_HashCode = TMP_TextUtilities.GetSimpleHashCode(m_Name);

            m_OpeningTagArray = new int[m_OpeningDefinition.Length];
            for (int i = 0; i < m_OpeningDefinition.Length; i++)
            {
                m_OpeningTagArray[i] = m_OpeningDefinition[i];
            }

            m_ClosingTagArray = new int[m_ClosingDefinition.Length];
            for (int i = 0; i < m_ClosingDefinition.Length; i++)
            {
                m_ClosingTagArray[i] = m_ClosingDefinition[i];
            }

#if UNITY_EDITOR
            // Event to update objects when styles are changed in the editor.
            TMPro_EventManager.ON_TEXT_STYLE_PROPERTY_CHANGED(true);
#endif
        }
示例#2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="packageName"></param>
        void ImportCallback(string packageName)
        {
            if (packageName == "TMP Essential Resources")
            {
                k_EssentialResourcesImported = true;
                TMPro_EventManager.ON_RESOURCES_LOADED();

                #if UNITY_2018_3_OR_NEWER
                SettingsService.NotifySettingsProviderChanged();
                #endif
            }
            else if (packageName == "TMP Examples & Extras")
            {
                k_ExamplesAndExtrasResourcesImported = true;
                k_IsImportingExamples = false;
            }

            Debug.Log("[" + packageName + "] have been imported.");

            AssetDatabase.importPackageCompleted -= ImportCallback;
        }
示例#3
0
        /// <summary>
        ///
        /// </summary>
        void OnValidate()
        {
            UpdateLookupTables();

            TMPro_EventManager.ON_SPRITE_ASSET_PROPERTY_CHANGED(true, this);
        }