[refactor] 调整HybridCLR.Editor模块一些不规范的命名空间

main
walon 2023-10-09 15:39:32 +08:00
parent a77ed7369a
commit 69de3d733d
13 changed files with 81 additions and 62 deletions

View File

@ -6,13 +6,14 @@ using System.Linq;
using System.Text; using System.Text;
using UnityEditor; using UnityEditor;
using System.Reflection; using System.Reflection;
using HybridCLR.Editor.Settings;
#if (UNITY_2020 || UNITY_2021) && UNITY_IOS #if (UNITY_2020 || UNITY_2021) && UNITY_IOS
using UnityEditor.Build; using UnityEditor.Build;
using UnityEditor.Callbacks; using UnityEditor.Callbacks;
using UnityEditor.iOS.Xcode; using UnityEditor.iOS.Xcode;
using UnityEngine; using UnityEngine;
namespace HybridCLR.Editor namespace HybridCLR.Editor.BuildProcessors
{ {
public static class AddLil2cppSourceCodeToXcodeproj2021OrOlder public static class AddLil2cppSourceCodeToXcodeproj2021OrOlder
{ {

View File

@ -8,7 +8,7 @@ using UnityEngine;
#if UNITY_2022_2_OR_NEWER && UNITY_IOS #if UNITY_2022_2_OR_NEWER && UNITY_IOS
namespace HybridCLR.Editor namespace HybridCLR.Editor.BuildProcessors
{ {
public static class AddLil2cppSourceCodeToXcodeproj2022OrNewer public static class AddLil2cppSourceCodeToXcodeproj2022OrNewer
{ {

View File

@ -1,4 +1,5 @@
using System; using HybridCLR.Editor.Settings;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;

View File

@ -3,8 +3,11 @@ using System;
using UnityEditor.Build; using UnityEditor.Build;
using UnityEditor.Build.Reporting; using UnityEditor.Build.Reporting;
public class MsvcStdextWorkaround : IPreprocessBuildWithReport namespace HybridCLR.Editor.BuildProcessors
{ {
public class MsvcStdextWorkaround : IPreprocessBuildWithReport
{
const string kWorkaroundFlag = "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS"; const string kWorkaroundFlag = "/D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS";
public int callbackOrder => 0; public int callbackOrder => 0;
@ -23,6 +26,7 @@ public class MsvcStdextWorkaround : IPreprocessBuildWithReport
Environment.SetEnvironmentVariable("_CL_", clEnv); Environment.SetEnvironmentVariable("_CL_", clEnv);
} }
} }
}
} }
#endif // UNITY_EDITOR #endif // UNITY_EDITOR

View File

@ -7,6 +7,7 @@ using UnityEngine;
using Debug = UnityEngine.Debug; using Debug = UnityEngine.Debug;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Linq; using System.Linq;
using HybridCLR.Editor.Settings;
namespace HybridCLR.Editor.Installer namespace HybridCLR.Editor.Installer
{ {

View File

@ -1,5 +1,6 @@
using dnlib.DotNet; using dnlib.DotNet;
using HybridCLR.Editor.Meta; using HybridCLR.Editor.Meta;
using HybridCLR.Editor.Settings;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;

View File

@ -3,12 +3,15 @@ using System;
using UnityEditor; using UnityEditor;
using UnityEditorInternal; using UnityEditorInternal;
/// <summary> namespace HybridCLR.Editor.Settings
/// 监听编辑器状态,当编辑器重新 focus 时,重新加载实例,避免某些情景下 svn 、git 等外部修改了数据却无法同步的异常。
/// </summary>
[InitializeOnLoad]
public static class EditorStatusWatcher
{ {
/// <summary>
/// 监听编辑器状态,当编辑器重新 focus 时,重新加载实例,避免某些情景下 svn 、git 等外部修改了数据却无法同步的异常。
/// </summary>
[InitializeOnLoad]
public static class EditorStatusWatcher
{
public static Action OnEditorFocused; public static Action OnEditorFocused;
static bool isFocused; static bool isFocused;
static EditorStatusWatcher() => EditorApplication.update += Update; static EditorStatusWatcher() => EditorApplication.update += Update;
@ -24,4 +27,6 @@ public static class EditorStatusWatcher
} }
} }
} }
}
} }

View File

@ -4,7 +4,8 @@ using UnityEditor;
using UnityEditor.Presets; using UnityEditor.Presets;
using UnityEngine; using UnityEngine;
using UnityEngine.UIElements; using UnityEngine.UIElements;
namespace HybridCLR.Editor
namespace HybridCLR.Editor.Settings
{ {
public class HybridCLRSettingsProvider : SettingsProvider public class HybridCLRSettingsProvider : SettingsProvider
{ {

View File

@ -1,6 +1,7 @@
using UnityEditorInternal; using UnityEditorInternal;
using UnityEngine; using UnityEngine;
namespace HybridCLR.Editor
namespace HybridCLR.Editor.Settings
{ {
[FilePath("ProjectSettings/HybridCLRSettings.asset")] [FilePath("ProjectSettings/HybridCLRSettings.asset")]
public class HybridCLRSettings : ScriptableSingleton<HybridCLRSettings> public class HybridCLRSettings : ScriptableSingleton<HybridCLRSettings>

View File

@ -2,8 +2,10 @@ using HybridCLR.Editor.Installer;
using UnityEditor; using UnityEditor;
using UnityEngine; using UnityEngine;
public static class MenuProvider namespace HybridCLR.Editor.Settings
{ {
public static class MenuProvider
{
[MenuItem("HybridCLR/About HybridCLR", priority = 0)] [MenuItem("HybridCLR/About HybridCLR", priority = 0)]
public static void OpenAbout() => Application.OpenURL("https://hybridclr.doc.code-philosophy.com/docs/intro"); public static void OpenAbout() => Application.OpenURL("https://hybridclr.doc.code-philosophy.com/docs/intro");
@ -32,5 +34,6 @@ public static class MenuProvider
[MenuItem("HybridCLR/Documents/Bug Report")] [MenuItem("HybridCLR/Documents/Bug Report")]
public static void OpenBugReport() => Application.OpenURL("https://hybridclr.doc.code-philosophy.com/docs/help/issue"); public static void OpenBugReport() => Application.OpenURL("https://hybridclr.doc.code-philosophy.com/docs/help/issue");
} }
}

View File

@ -5,7 +5,7 @@ using UnityEditor;
using UnityEditorInternal; using UnityEditorInternal;
using UnityEngine; using UnityEngine;
namespace HybridCLR.Editor namespace HybridCLR.Editor.Settings
{ {
public class ScriptableSingleton<T> : ScriptableObject where T : ScriptableObject public class ScriptableSingleton<T> : ScriptableObject where T : ScriptableObject
{ {

View File

@ -2,7 +2,7 @@ using UnityEditor;
using UnityEditor.Presets; using UnityEditor.Presets;
using UnityEngine; using UnityEngine;
namespace HybridCLR.Editor namespace HybridCLR.Editor.Settings
{ {
public class SettingsPresetReceiver : PresetSelectorReceiver public class SettingsPresetReceiver : PresetSelectorReceiver
{ {

View File

@ -5,6 +5,7 @@ using System.Linq;
using UnityEditor; using UnityEditor;
using UnityEditorInternal; using UnityEditorInternal;
using UnityEngine; using UnityEngine;
using HybridCLR.Editor.Settings;
namespace HybridCLR.Editor namespace HybridCLR.Editor