TMP_ResourcesLoader.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. using UnityEditor;
  2. using UnityEngine;
  3. using System.Collections;
  4. namespace TMPro.EditorUtilities
  5. {
  6. //[InitializeOnLoad]
  7. class TMP_ResourcesLoader
  8. {
  9. /// <summary>
  10. /// Function to pre-load the TMP Resources
  11. /// </summary>
  12. public static void LoadTextMeshProResources()
  13. {
  14. //TMP_Settings.LoadDefaultSettings();
  15. //TMP_StyleSheet.LoadDefaultStyleSheet();
  16. }
  17. static TMP_ResourcesLoader()
  18. {
  19. //Debug.Log("Loading TMP Resources...");
  20. // Get current targetted platform
  21. //string Settings = PlayerSettings.GetScriptingDefineSymbolsForGroup(BuildTargetGroup.Standalone);
  22. //TMPro.TMP_Settings.LoadDefaultSettings();
  23. //TMPro.TMP_StyleSheet.LoadDefaultStyleSheet();
  24. }
  25. //[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
  26. //static void OnBeforeSceneLoaded()
  27. //{
  28. //Debug.Log("Before scene is loaded.");
  29. // //TMPro.TMP_Settings.LoadDefaultSettings();
  30. // //TMPro.TMP_StyleSheet.LoadDefaultStyleSheet();
  31. // //ShaderVariantCollection collection = new ShaderVariantCollection();
  32. // //Shader s0 = Shader.Find("TextMeshPro/Mobile/Distance Field");
  33. // //ShaderVariantCollection.ShaderVariant tmp_Variant = new ShaderVariantCollection.ShaderVariant(s0, UnityEngine.Rendering.PassType.Normal, string.Empty);
  34. // //collection.Add(tmp_Variant);
  35. // //collection.WarmUp();
  36. //}
  37. }
  38. //static class TMP_ProjectSettings
  39. //{
  40. // [InitializeOnLoadMethod]
  41. // static void SetProjectDefineSymbols()
  42. // {
  43. // string currentBuildSettings = PlayerSettings.GetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup);
  44. // //Check for and inject TMP_INSTALLED
  45. // if (!currentBuildSettings.Contains("TMP_PRESENT"))
  46. // {
  47. // PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, currentBuildSettings + ";TMP_PRESENT");
  48. // }
  49. // }
  50. //}
  51. }