diff --git a/Src/Core/BITLog/BIT4Log.cs b/Src/Core/BITLog/BIT4Log.cs index f3d660a..8c35e84 100644 --- a/Src/Core/BITLog/BIT4Log.cs +++ b/Src/Core/BITLog/BIT4Log.cs @@ -1,6 +1,6 @@ using System; using System.Diagnostics; -#if UNITY_64 +#if UNITY_5_3_OR_NEWER using UnityEngine; #endif @@ -25,7 +25,7 @@ namespace BITKit public static event Action OnSetConsoleColor; public static event Action OnNextLine; private static Type currentType; -#if UNITY_64 +#if UNITY_5_3_OR_NEWER //[HideInCallstack] #endif public static void Log(object x, ConsoleColor color = ConsoleColor.White) @@ -33,7 +33,7 @@ namespace BITKit OnSetConsoleColor?.Invoke(color); OnLog?.Invoke(x?.ToString()); } -#if UNITY_64 +#if UNITY_5_3_OR_NEWER [HideInCallstack] #endif public static void Log(object x, ConsoleColor color = ConsoleColor.White) @@ -50,21 +50,21 @@ namespace BITKit currentType = typeof(T); } -#if UNITY_64 +#if UNITY_5_3_OR_NEWER [HideInCallstack] #endif public static void LogException(Exception e) { OnException?.Invoke(e); } -#if UNITY_64 +#if UNITY_5_3_OR_NEWER [HideInCallstack] #endif public static void Warning(object x) { OnWarning?.Invoke(x.ToString()); } -#if UNITY_64 +#if UNITY_5_3_OR_NEWER [HideInCallstack] #endif public static void Warning(object x) diff --git a/Src/Core/Commands/BITCommand.cs b/Src/Core/Commands/BITCommand.cs index 3d5e153..91a1d1a 100644 --- a/Src/Core/Commands/BITCommand.cs +++ b/Src/Core/Commands/BITCommand.cs @@ -4,12 +4,12 @@ using System.Linq; using System.Reflection; using Cysharp.Threading.Tasks; using System.Text; -#if UNITY_64 +#if UNITY_5_3_OR_NEWER using UnityEngine; #endif namespace BITKit { -#if UNITY_64 +#if UNITY_5_3_OR_NEWER [Serializable] public sealed class ExecuteCommandAction : IAction { diff --git a/Src/Core/Mod/ModService.cs b/Src/Core/Mod/ModService.cs index 8160e4b..1ccccfb 100644 --- a/Src/Core/Mod/ModService.cs +++ b/Src/Core/Mod/ModService.cs @@ -253,7 +253,7 @@ namespace BITKit.Mod await Load(assembly); continue; } -#if UNITY_64 +#if UNITY_5_3_OR_NEWER case ".cs": { var code = await File.ReadAllTextAsync(fileInfo.FullName); @@ -352,7 +352,7 @@ namespace BITKit.Mod //Thread.Sleep(1000); -#if UNITY_64 +#if UNITY_5_3_OR_NEWER await UniTask.Delay(1000); #else await Task.Delay(1000); @@ -465,7 +465,7 @@ namespace BITKit.Mod await Load(assembly, fileInfo.DirectoryName); break; } -#if UNITY_64 +#if UNITY_5_3_OR_NEWER case ".cs": { var code = await File.ReadAllTextAsync(fileInfo.FullName); diff --git a/Src/Core/Selection/ISelectable.cs b/Src/Core/Selection/ISelectable.cs index 47d3d78..b20093e 100644 --- a/Src/Core/Selection/ISelectable.cs +++ b/Src/Core/Selection/ISelectable.cs @@ -17,7 +17,7 @@ namespace BITKit } public interface ISelectable { - #if UNITY_64 + #if UNITY_5_3_OR_NEWER UnityEngine.Transform Transform { get; } #endif void SetSelectionState(SelectionState state); diff --git a/Src/Core/Sharp/BITSharp.cs b/Src/Core/Sharp/BITSharp.cs index 6dfcfe7..317bb43 100644 --- a/Src/Core/Sharp/BITSharp.cs +++ b/Src/Core/Sharp/BITSharp.cs @@ -11,7 +11,7 @@ using System.Text; using System.Threading; using BITKit.Mod; -#if UNITY_64 +#if UNITY_5_3_OR_NEWER using System.Collections; using BITKit.UX; using UnityEngine; @@ -26,7 +26,7 @@ namespace BITKit { public class BITSharp { -#if UNITY_64 +#if UNITY_5_3_OR_NEWER [RuntimeInitializeOnLoadMethod] private static void Reload() { @@ -60,7 +60,7 @@ namespace BITKit assemblies ??= AppDomain.CurrentDomain.GetAssemblies(); return assemblies.Select(assembly => assembly.GetType(fullName, false)).FirstOrDefault(type => type is not null); } -#if UNITY_64 +#if UNITY_5_3_OR_NEWER public static Assembly Compile(params string[] codes) { diff --git a/Src/Core/Storage/ApplicationFile.cs b/Src/Core/Storage/ApplicationFile.cs index d1999a4..b35005f 100644 --- a/Src/Core/Storage/ApplicationFile.cs +++ b/Src/Core/Storage/ApplicationFile.cs @@ -1,4 +1,4 @@ -#if UNITY_64 +#if UNITY_5_3_OR_NEWER using System; using System.Collections; using System.Collections.Concurrent; @@ -34,7 +34,7 @@ namespace BITKit.IO { private const string DefaultPath = nameof(ApplicationFile)+"."+nameof(DefaultPath); - #if UNITY_64 + #if UNITY_5_3_OR_NEWER [UnityEngine.RuntimeInitializeOnLoadMethod] private static void Reload() { @@ -66,7 +66,7 @@ namespace BITKit.IO get { var bp = new BrowserProperties(); - #if UNITY_64 + #if UNITY_5_3_OR_NEWER if (PlayerPrefs.HasKey(DefaultPath)) { bp.initialDir = PlayerPrefs.GetString(DefaultPath); diff --git a/Src/Core/Utility/Constant.cs b/Src/Core/Utility/Constant.cs index ec9e35a..c1e278b 100644 --- a/Src/Core/Utility/Constant.cs +++ b/Src/Core/Utility/Constant.cs @@ -1,5 +1,5 @@ using System; -#if UNITY_64 +#if UNITY_5_3_OR_NEWER using UnityEngine; #endif namespace BITKit @@ -8,7 +8,7 @@ namespace BITKit { public ConstantHash(object value) { -#if UNITY_64 +#if UNITY_5_3_OR_NEWER HashCode = Animator.StringToHash(value.ToString()); #else HashCode = value.GetHashCode(); diff --git a/Src/Unity/Scripts/UX/ApplicationFile/UXApplicationFile.cs b/Src/Unity/Scripts/UX/ApplicationFile/UXApplicationFile.cs index fd042d7..cac4711 100644 --- a/Src/Unity/Scripts/UX/ApplicationFile/UXApplicationFile.cs +++ b/Src/Unity/Scripts/UX/ApplicationFile/UXApplicationFile.cs @@ -8,7 +8,7 @@ using UnityEngine.UIElements; namespace BITKit.UX { -#if UNITY_64 +#if UNITY_5_3_OR_NEWER public class UXApplicationFile : MonoBehaviour { [SerializeReference, SubclassSelector] private IApplicationFile applicationFile; diff --git a/Src/Unity/Scripts/UX/ModService/UXModService.cs b/Src/Unity/Scripts/UX/ModService/UXModService.cs index 06a8f42..87e9a56 100644 --- a/Src/Unity/Scripts/UX/ModService/UXModService.cs +++ b/Src/Unity/Scripts/UX/ModService/UXModService.cs @@ -5,7 +5,7 @@ using System.Collections.Generic; using System.IO; using System.Reflection; using System.Threading; -#if UNITY_64 +#if UNITY_5_3_OR_NEWER using AnotherFileBrowser.Windows; #endif using BITKit.Mod; @@ -143,7 +143,7 @@ namespace BITKit.UX return; void OpenModInternal() { - #if UNITY_64 + #if UNITY_5_3_OR_NEWER BIT4Log.Log("已进入文件对话框线程"); new FileBrowser().OpenFileBrowser(new BrowserProperties() { @@ -165,7 +165,7 @@ namespace BITKit.UX switch (file.Extension) { case ".cs": - #if UNITY_64 + #if UNITY_5_3_OR_NEWER var code = await File.ReadAllTextAsync(path); var assembly = BITSharp.Compile(code); await ModService.Load(assembly,Path.GetDirectoryName(path));