Skip to content

Commit

Permalink
organized
Browse files Browse the repository at this point in the history
  • Loading branch information
michael811125 committed Mar 29, 2024
1 parent 4488a22 commit c58e046
Show file tree
Hide file tree
Showing 9 changed files with 192 additions and 191 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ internal static BundleCryptogramUtilityWindow GetInstance()

private CryptogramSetting _setting;

internal static string PROJECT_PATH;
internal static string KEY_SAVER;
internal static string projectPath;
internal static string keySaver;

private static Vector2 _windowSize = new Vector2(800f, 150f);

[MenuItem(BundleHelper.MENU_ROOT + "Bundle Cryptogram Utility (For Verify)", false, 699)]
public static void ShowWindow()
{
PROJECT_PATH = Application.dataPath;
KEY_SAVER = $"{PROJECT_PATH}_{nameof(BundleCryptogramUtilityWindow)}";
projectPath = Application.dataPath;
keySaver = $"{projectPath}_{nameof(BundleCryptogramUtilityWindow)}";

_instance = null;
GetInstance().titleContent = new GUIContent("Bundle Cryptogram Utility");
Expand All @@ -54,8 +54,8 @@ private void OnEnable()
{
this._setting = EditorTool.LoadSettingData<CryptogramSetting>();
this._LoadSettingsData();
this.sourceFolder = EditorStorage.GetData(KEY_SAVER, $"sourceFolder", Path.Combine($"{Application.dataPath}/", AssetBundleBuilderHelper.GetDefaultBuildOutputRoot()));
this.cryptogramType = (CryptogramType)Convert.ToInt32(EditorStorage.GetData(KEY_SAVER, "cryptogramType", "0"));
this.sourceFolder = EditorStorage.GetData(keySaver, $"sourceFolder", Path.Combine($"{Application.dataPath}/", AssetBundleBuilderHelper.GetDefaultBuildOutputRoot()));
this.cryptogramType = (CryptogramType)Convert.ToInt32(EditorStorage.GetData(keySaver, "cryptogramType", "0"));
}

private void _LoadSettingsData()
Expand All @@ -80,7 +80,7 @@ private void OnGUI()
EditorGUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
this.sourceFolder = EditorGUILayout.TextField("Source Folder", this.sourceFolder);
if (EditorGUI.EndChangeCheck()) EditorStorage.SaveData(KEY_SAVER, "sourceFolder", this.sourceFolder);
if (EditorGUI.EndChangeCheck()) EditorStorage.SaveData(keySaver, "sourceFolder", this.sourceFolder);
Color bc = GUI.backgroundColor;
GUI.backgroundColor = new Color32(0, 255, 128, 255);
if (GUILayout.Button("Open", GUILayout.MaxWidth(100f))) BundleUtility.OpenFolder(this.sourceFolder);
Expand All @@ -98,7 +98,7 @@ private void OnGUI()
// cryptogram options area
EditorGUI.BeginChangeCheck();
this.cryptogramType = (CryptogramType)EditorGUILayout.EnumPopup("Cryptogram Type", this.cryptogramType);
if (EditorGUI.EndChangeCheck()) EditorStorage.SaveData(KEY_SAVER, "cryptogramType", ((int)this.cryptogramType).ToString());
if (EditorGUI.EndChangeCheck()) EditorStorage.SaveData(keySaver, "cryptogramType", ((int)this.cryptogramType).ToString());

EditorGUILayout.EndHorizontal();

Expand Down Expand Up @@ -321,9 +321,9 @@ private void _DrawOperateButtonsView(CryptogramType cryptogramType)

private void _OpenSourceFolder()
{
string folderPath = EditorStorage.GetData(KEY_SAVER, "sourceFolder", Path.Combine($"{Application.dataPath}/", AssetBundleBuilderHelper.GetDefaultBuildOutputRoot()));
string folderPath = EditorStorage.GetData(keySaver, "sourceFolder", Path.Combine($"{Application.dataPath}/", AssetBundleBuilderHelper.GetDefaultBuildOutputRoot()));
this.sourceFolder = EditorUtility.OpenFolderPanel("Open Source Folder", folderPath, string.Empty);
if (!string.IsNullOrEmpty(this.sourceFolder)) EditorStorage.SaveData(KEY_SAVER, "sourceFolder", this.sourceFolder);
if (!string.IsNullOrEmpty(this.sourceFolder)) EditorStorage.SaveData(keySaver, "sourceFolder", this.sourceFolder);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ internal static BundleUrlConfigGeneratorWindow GetInstance()
[SerializeField]
public bool autoReveal;

internal static string PROJECT_PATH;
internal static string KEY_SAVER;
internal static string projectPath;
internal static string keySaver;

private static Vector2 _windowSize = new Vector2(800f, 150f);

[MenuItem(BundleHelper.MENU_ROOT + "Bundle Url Config Generator (burlconfig.conf)", false, 899)]
public static void ShowWindow()
{
PROJECT_PATH = Application.dataPath;
KEY_SAVER = $"{PROJECT_PATH}_{nameof(BundleUrlConfigGeneratorWindow)}";
projectPath = Application.dataPath;
keySaver = $"{projectPath}_{nameof(BundleUrlConfigGeneratorWindow)}";

_instance = null;
GetInstance().titleContent = new GUIContent("Bundle Url Config Generator");
Expand All @@ -43,11 +43,11 @@ public static void ShowWindow()

private void OnEnable()
{
this.bundleIp = EditorStorage.GetData(KEY_SAVER, "bundleIp", "127.0.0.1");
this.bundleFallbackIp = EditorStorage.GetData(KEY_SAVER, "bundleFallbackIp", "127.0.0.1");
this.storeLink = EditorStorage.GetData(KEY_SAVER, "storeLink", "http://");
this.bundleIp = EditorStorage.GetData(keySaver, "bundleIp", "127.0.0.1");
this.bundleFallbackIp = EditorStorage.GetData(keySaver, "bundleFallbackIp", "127.0.0.1");
this.storeLink = EditorStorage.GetData(keySaver, "storeLink", "http://");

this.autoReveal = Convert.ToBoolean(EditorStorage.GetData(KEY_SAVER, "autoReveal", "true"));
this.autoReveal = Convert.ToBoolean(EditorStorage.GetData(keySaver, "autoReveal", "true"));
}

private void OnGUI()
Expand Down Expand Up @@ -91,7 +91,7 @@ private void _DrawBundleIPTextFieldView()
EditorGUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
this.bundleIp = EditorGUILayout.TextField("Bundle IP", this.bundleIp);
if (EditorGUI.EndChangeCheck()) EditorStorage.SaveData(KEY_SAVER, "bundleIp", this.bundleIp);
if (EditorGUI.EndChangeCheck()) EditorStorage.SaveData(keySaver, "bundleIp", this.bundleIp);
EditorGUILayout.EndHorizontal();
}

Expand All @@ -102,7 +102,7 @@ private void _DrawBundleFallbackIPTextFieldView()
EditorGUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
this.bundleFallbackIp = EditorGUILayout.TextField("Bundle Fallback IP", this.bundleFallbackIp);
if (EditorGUI.EndChangeCheck()) EditorStorage.SaveData(KEY_SAVER, "bundleFallbackIp", this.bundleFallbackIp);
if (EditorGUI.EndChangeCheck()) EditorStorage.SaveData(keySaver, "bundleFallbackIp", this.bundleFallbackIp);
EditorGUILayout.EndHorizontal();
}

Expand All @@ -113,7 +113,7 @@ private void _DrawStoreLinkTextFieldView()
EditorGUILayout.BeginHorizontal();
EditorGUI.BeginChangeCheck();
this.storeLink = EditorGUILayout.TextField("Store Link", this.storeLink);
if (EditorGUI.EndChangeCheck()) EditorStorage.SaveData(KEY_SAVER, "storeLink", this.storeLink);
if (EditorGUI.EndChangeCheck()) EditorStorage.SaveData(keySaver, "storeLink", this.storeLink);
EditorGUILayout.EndHorizontal();
}

Expand All @@ -127,7 +127,7 @@ private void _DrawProcessButtonView()

// auto reveal toggle
this.autoReveal = GUILayout.Toggle(this.autoReveal, new GUIContent("Auto Reveal", "If checked, after process will reveal destination folder."));
EditorStorage.SaveData(KEY_SAVER, "autoReveal", this.autoReveal.ToString());
EditorStorage.SaveData(keySaver, "autoReveal", this.autoReveal.ToString());

// process button
Color bc = GUI.backgroundColor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ internal static CryptogramSettingWindow GetInstance()
private CryptogramSetting _setting;
private bool _isDirty = false;

internal static string PROJECT_PATH;
internal static string KEY_SAVER;
internal static string projectPath;
internal static string keySaver;

private static Vector2 _windowSize = new Vector2(800f, 150f);

[MenuItem("YooAsset/" + "OxGFrame Cryptogram Setting With YooAsset", false, 999)]
public static void ShowWindow()
{
PROJECT_PATH = Application.dataPath;
KEY_SAVER = $"{PROJECT_PATH}_{nameof(CryptogramSettingWindow)}";
projectPath = Application.dataPath;
keySaver = $"{projectPath}_{nameof(CryptogramSettingWindow)}";

_instance = null;
GetInstance().titleContent = new GUIContent("Cryptogram Setting");
Expand All @@ -50,7 +50,7 @@ private void OnEnable()
this._isDirty = false;
this._setting = EditorTool.LoadSettingData<CryptogramSetting>();
this._LoadSettingsData();
this.cryptogramType = (CryptogramType)Convert.ToInt32(EditorStorage.GetData(KEY_SAVER, "cryptogramType", "0"));
this.cryptogramType = (CryptogramType)Convert.ToInt32(EditorStorage.GetData(keySaver, "cryptogramType", "0"));
}

private void OnGUI()
Expand All @@ -64,7 +64,7 @@ private void OnGUI()
{
this._isDirty = false;
this._LoadSettingsData();
EditorStorage.SaveData(KEY_SAVER, "cryptogramType", ((int)this.cryptogramType).ToString());
EditorStorage.SaveData(keySaver, "cryptogramType", ((int)this.cryptogramType).ToString());
}

EditorGUILayout.EndHorizontal();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ namespace OxGFrame.CenterFrame.Editor
public static class CenterFrameCreateScriptEditor
{
// EventCenter
private const string TPL_EVENT_BASE_SCRIPT_PATH = "TplScripts/EventCenter/TplEvent.cs.txt";
private const string TPL_EVENT_CENTER_SCRIPT_PATH = "TplScripts/EventCenter/TplEventCenter.cs.txt";
private const string _TPL_EVENT_BASE_SCRIPT_PATH = "TplScripts/EventCenter/TplEvent.cs.txt";
private const string _TPL_EVENT_CENTER_SCRIPT_PATH = "TplScripts/EventCenter/TplEventCenter.cs.txt";

// APICenter
private const string TPL_API_CENTER_SCRIPT_PATH = "TplScripts/APICenter/TplAPICenter.cs.txt";
private const string TPL_API_BASE_SCRIPT_PATH = "TplScripts/APICenter/TplAPI.cs.txt";
private const string _TPL_API_CENTER_SCRIPT_PATH = "TplScripts/APICenter/TplAPICenter.cs.txt";
private const string _TPL_API_BASE_SCRIPT_PATH = "TplScripts/APICenter/TplAPI.cs.txt";

// find current file path
private static string _pathFinder
Expand All @@ -27,7 +27,7 @@ private static string _pathFinder
public static void CreateScriptTplEventBase()
{
string currentPath = _pathFinder;
string finalPath = currentPath.Replace("CenterFrameCreateScriptEditor.cs", "") + TPL_EVENT_BASE_SCRIPT_PATH;
string finalPath = currentPath.Replace("CenterFrameCreateScriptEditor.cs", "") + _TPL_EVENT_BASE_SCRIPT_PATH;

ProjectWindowUtil.CreateScriptAssetFromTemplateFile(finalPath, "NewTplEvent.cs");
}
Expand All @@ -36,7 +36,7 @@ public static void CreateScriptTplEventBase()
public static void CreateScriptTplEventCenter()
{
string currentPath = _pathFinder;
string finalPath = currentPath.Replace("CenterFrameCreateScriptEditor.cs", "") + TPL_EVENT_CENTER_SCRIPT_PATH;
string finalPath = currentPath.Replace("CenterFrameCreateScriptEditor.cs", "") + _TPL_EVENT_CENTER_SCRIPT_PATH;

ProjectWindowUtil.CreateScriptAssetFromTemplateFile(finalPath, "NewTplEventCenter.cs");
}
Expand All @@ -47,7 +47,7 @@ public static void CreateScriptTplEventCenter()
public static void CreateScriptTplAPIBase()
{
string currentPath = _pathFinder;
string finalPath = currentPath.Replace("CenterFrameCreateScriptEditor.cs", "") + TPL_API_BASE_SCRIPT_PATH;
string finalPath = currentPath.Replace("CenterFrameCreateScriptEditor.cs", "") + _TPL_API_BASE_SCRIPT_PATH;

ProjectWindowUtil.CreateScriptAssetFromTemplateFile(finalPath, "NewTplAPI.cs");
}
Expand All @@ -56,7 +56,7 @@ public static void CreateScriptTplAPIBase()
public static void CreateScriptTplAPICenter()
{
string currentPath = _pathFinder;
string finalPath = currentPath.Replace("CenterFrameCreateScriptEditor.cs", "") + TPL_API_CENTER_SCRIPT_PATH;
string finalPath = currentPath.Replace("CenterFrameCreateScriptEditor.cs", "") + _TPL_API_CENTER_SCRIPT_PATH;

ProjectWindowUtil.CreateScriptAssetFromTemplateFile(finalPath, "NewTplAPICenter.cs");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ namespace OxGFrame.CoreFrame.Editor
public static class CoreFrameCreateScriptEditor
{
// SRFrame
private const string TPL_SR_SCRIPT_PATH = "TplScripts/SRFrame/TplSR.cs.txt";
private const string _TPL_SR_SCRIPT_PATH = "TplScripts/SRFrame/TplSR.cs.txt";

// UIFrame
private const string TPL_UI_SCRIPT_PATH = "TplScripts/UIFrame/TplUI.cs.txt";
private const string _TPL_UI_SCRIPT_PATH = "TplScripts/UIFrame/TplUI.cs.txt";

// CPFrame
private const string TPL_CP_SCRIPT_PATH = "TplScripts/CPFrame/TplCP.cs.txt";
private const string _TPL_CP_SCRIPT_PATH = "TplScripts/CPFrame/TplCP.cs.txt";

// find current file path
private static string _pathFinder
Expand All @@ -28,7 +28,7 @@ private static string _pathFinder
public static void CreateScriptTplSR()
{
string currentPath = _pathFinder;
string finalPath = currentPath.Replace("CoreFrameCreateScriptEditor.cs", "") + TPL_SR_SCRIPT_PATH;
string finalPath = currentPath.Replace("CoreFrameCreateScriptEditor.cs", "") + _TPL_SR_SCRIPT_PATH;

ProjectWindowUtil.CreateScriptAssetFromTemplateFile(finalPath, "NewTplSR.cs");
}
Expand All @@ -39,7 +39,7 @@ public static void CreateScriptTplSR()
public static void CreateScriptTplUI()
{
string currentPath = _pathFinder;
string finalPath = currentPath.Replace("CoreFrameCreateScriptEditor.cs", "") + TPL_UI_SCRIPT_PATH;
string finalPath = currentPath.Replace("CoreFrameCreateScriptEditor.cs", "") + _TPL_UI_SCRIPT_PATH;

ProjectWindowUtil.CreateScriptAssetFromTemplateFile(finalPath, "NewTplUI.cs");
}
Expand All @@ -50,7 +50,7 @@ public static void CreateScriptTplUI()
public static void CreateScriptTplCP()
{
string currentPath = _pathFinder;
string finalPath = currentPath.Replace("CoreFrameCreateScriptEditor.cs", "") + TPL_CP_SCRIPT_PATH;
string finalPath = currentPath.Replace("CoreFrameCreateScriptEditor.cs", "") + _TPL_CP_SCRIPT_PATH;

ProjectWindowUtil.CreateScriptAssetFromTemplateFile(finalPath, "NewTplCP.cs");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace OxGFrame.GSIFrame.Editor
public static class GSIFrameCreateScriptEditor
{
// Template GSIManager Path
private const string TPL_GSI_MANAGER_SCRIPT_PATH = "TplScripts/GSIFrame/TplGSIManager.cs.txt";
private const string _TPL_GSI_MANAGER_SCRIPT_PATH = "TplScripts/GSIFrame/TplGSIManager.cs.txt";
// Template GSIBase Path
private const string TPL_GSI_BASE_SCRIPT_PATH = "TplScripts/GSIFrame/TplGSI.cs.txt";
private const string _TPL_GSI_BASE_SCRIPT_PATH = "TplScripts/GSIFrame/TplGSI.cs.txt";

// find current file path
private static string _pathFinder
Expand All @@ -24,7 +24,7 @@ private static string _pathFinder
public static void CreateScriptTplGSIBase()
{
string currentPath = _pathFinder;
string finalPath = currentPath.Replace("GSIFrameCreateScriptEditor.cs", "") + TPL_GSI_BASE_SCRIPT_PATH;
string finalPath = currentPath.Replace("GSIFrameCreateScriptEditor.cs", "") + _TPL_GSI_BASE_SCRIPT_PATH;

ProjectWindowUtil.CreateScriptAssetFromTemplateFile(finalPath, "NewTplGSI.cs");
}
Expand All @@ -33,7 +33,7 @@ public static void CreateScriptTplGSIBase()
public static void CreateScriptTplGSIManager()
{
string currentPath = _pathFinder;
string finalPath = currentPath.Replace("GSIFrameCreateScriptEditor.cs", "") + TPL_GSI_MANAGER_SCRIPT_PATH;
string finalPath = currentPath.Replace("GSIFrameCreateScriptEditor.cs", "") + _TPL_GSI_MANAGER_SCRIPT_PATH;

ProjectWindowUtil.CreateScriptAssetFromTemplateFile(finalPath, "NewTplGSIManager.cs");
}
Expand Down
Loading

0 comments on commit c58e046

Please sign in to comment.