Esempio n. 1
0
        private static void Open()
        {
            var frameworkConfigEditorWindow = (PreferencesWindow)GetWindow(typeof(PreferencesWindow), true);

            frameworkConfigEditorWindow.titleContent   = new GUIContent("QFramework Settings");
            frameworkConfigEditorWindow.CurSettingData = QFrameworkSettingData.Load();
            frameworkConfigEditorWindow.Show();
            OnShow();
        }
Esempio n. 2
0
        private void CreateUIPanelCode(GameObject uiPrefab, string uiPrefabPath)
        {
            if (null == uiPrefab)
            {
                return;
            }

            var behaviourName = uiPrefab.name;

            var strFilePath = string.Empty;

            var prefabDirPattern = QFrameworkSettingData.Load().UIPrefabDir;

            if (uiPrefabPath.Contains(prefabDirPattern))
            {
                strFilePath = uiPrefabPath.Replace(prefabDirPattern, GetScriptsPath());
            }
            else if (uiPrefabPath.Contains("/Resources"))
            {
                strFilePath = uiPrefabPath.Replace("/Resources", GetScriptsPath());
            }
            else
            {
                strFilePath = uiPrefabPath.Replace("/" + uiPrefabPath.GetLastDirName(), GetScriptsPath());
            }

            strFilePath.Replace(uiPrefab.name + ".prefab", string.Empty).CreateDirIfNotExists();

            strFilePath = strFilePath.Replace(".prefab", ".cs");

            if (File.Exists(strFilePath) == false)
            {
                UIPanelCodeTemplate.Generate(strFilePath, behaviourName, GetProjectNamespace());
            }

            CreateUIPanelComponentsCode(behaviourName, strFilePath);
            Debug.Log(">>>>>>>Success Create UIPrefab Code: " + behaviourName);
        }
Esempio n. 3
0
 private static string GetProjectNamespace()
 {
     return(QFrameworkSettingData.Load().Namespace);
 }
Esempio n. 4
0
 private static string GetScriptsPath()
 {
     return(QFrameworkSettingData.Load().UIScriptDir);
 }