Ejemplo n.º 1
0
 public static void EnableTextMeshPro()
 {
     if (!XChartsMgr.IsExistTMPAssembly())
     {
         Debug.LogError("TextMeshPro is not in the project, please import TextMeshPro package first.");
         return;
     }
     XChartsMgr.ModifyTMPRefence();
     XChartsMgr.EnableTextMeshPro();
 }
        public void OnGUI()
        {
            m_EssentialResourcesImported         = File.Exists("Assets/XCharts/Resources/XChartsSettings.asset");
            m_ExamplesAndExtrasResourcesImported = Directory.Exists("Assets/XCharts/Examples & Extras");

            GUILayout.BeginVertical();
            {
                GUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    GUILayout.Label("XCharts Essentials", EditorStyles.boldLabel);
                    GUILayout.Label("This appears to be the first time you access XCharts, as such we need to add resources to your project that are essential for using XCharts. These new resources will be placed at the root of your project in the \"XCharts\" folder.", new GUIStyle(EditorStyles.label)
                    {
                        wordWrap = true
                    });
                    GUILayout.Space(5f);

                    GUI.enabled = !m_EssentialResourcesImported;
                    if (GUILayout.Button("Import XCharts Essentials"))
                    {
                        AssetDatabase.importPackageCompleted += ImportCallback;

                        string packageFullPath = GetPackageFullPath();
                        Debug.LogError("packageFullPath:" + packageFullPath);
                        AssetDatabase.ImportPackage(packageFullPath + "/Package Resources/XCharts Essential Resources.unitypackage", false);
                    }
                    GUILayout.Space(5f);
                    GUI.enabled = true;
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndVertical();

            GUILayout.BeginVertical();
            {
                GUILayout.BeginVertical(EditorStyles.helpBox);
                {
                    GUILayout.Label("TextMeshPro", EditorStyles.boldLabel);
#if dUI_TextMeshPro
                    GUILayout.Label("TextMeshPro is now enabled. You can turn it off by clicking the button below.", new GUIStyle(EditorStyles.label)
                    {
                        wordWrap = true
                    });
                    GUILayout.Space(5f);
                    if (GUILayout.Button("Disable TextMeshPro"))
                    {
                        XChartsMgr.DisableTextMeshPro();
                    }
#else
                    GUILayout.Label("TextMeshPro is not active. You can activate it by clicking the button below. Make sure TextMeshPro is already in your project before activating it.", new GUIStyle(EditorStyles.label)
                    {
                        wordWrap = true
                    });
                    GUILayout.Space(5f);
                    if (GUILayout.Button("Enable TextMeshPro"))
                    {
                        XChartsMgr.EnableTextMeshPro();
                    }
#endif
                    GUILayout.Space(5f);
                }
                GUILayout.EndVertical();
            }
            GUILayout.EndVertical();
            GUILayout.Space(5f);
        }
Ejemplo n.º 3
0
 public static void EnableTextMeshPro()
 {
     XChartsMgr.EnableTextMeshPro();
 }