Пример #1
0
        void OnEnable()
        {
            if (Instance == null)
            {
                // Load settings from TMP_Settings file
                TMP_Settings settings = Resources.Load("TMP Settings") as TMP_Settings;
                if (settings == null)
                {
                    return;
                }

                if (settings.styleSheet != null)
                {
                    Instance = settings.styleSheet;
                }
                else
                {
                    Instance = Resources.Load("Style Sheets/TMP Default Style Sheet") as TMP_StyleSheet;
                }


                if (!m_isDictionaryLoaded)
                {
                    Instance.LoadStyleDictionary();
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Static Function to load the Default Style Sheet.
        /// </summary>
        /// <returns></returns>
        public static TMP_StyleSheet LoadDefaultStyleSheet()
        {
            //Debug.Log("Loading Default StyleSheet.");

            if (Instance == null)
            {
                Instance = Resources.Load("TMP_DefaultStyleSheet") as TMP_StyleSheet;
                if (!m_isDictionaryLoaded) Instance.LoadStyleDictionary();
            }

            return Instance;
        }
 private void OnEnable()
 {
     if (Instance == null)
     {
         TMP_Settings tMP_Settings = Resources.Load("TMP Settings") as TMP_Settings;
         if (!(tMP_Settings == null))
         {
             if (tMP_Settings.styleSheet != null)
             {
                 Instance = tMP_Settings.styleSheet;
             }
             else
             {
                 Instance = (Resources.Load("Style Sheets/TMP Default Style Sheet") as TMP_StyleSheet);
             }
             if (!m_isDictionaryLoaded)
             {
                 Instance.LoadStyleDictionary();
             }
         }
     }
 }
Пример #4
0
        void OnEnable()
        {
            //Debug.Log("TMP_StyleSheet - OnEnable() called.");

            if (Instance == null)
            {
                Instance = Resources.Load("TMP_DefaultStyleSheet") as TMP_StyleSheet;
                if (!m_isDictionaryLoaded) Instance.LoadStyleDictionary();
            }
        }