private static void Open() { var frameworkConfigEditorWindow = (PreferencesWindow)GetWindow(typeof(PreferencesWindow), true); frameworkConfigEditorWindow.titleContent = new GUIContent("QFramework Settings"); frameworkConfigEditorWindow.CurSettingData = FrameworkSettingData.Load(); frameworkConfigEditorWindow.position = new Rect(100, 100, 500, 400); frameworkConfigEditorWindow.Show(); }
private void CreateUIPanelCode(GameObject uiPrefab, string uiPrefabPath) { if (null == uiPrefab) { return; } var behaviourName = uiPrefab.name; var strFilePath = string.Empty; var prefabDirPattern = FrameworkSettingData.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); }
private static string GetProjectNamespace() { return(FrameworkSettingData.Load().Namespace); }
private static string GetScriptsPath() { return(FrameworkSettingData.Load().UIScriptDir); }
public UIKitSettingView() { mFrameworkSettingData = FrameworkSettingData.Load(); }