This commit is contained in:
parent
349877fe7a
commit
ca93bd2c56
|
@ -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<ConsoleColor> 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<T>(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<T>(object x)
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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<UXModService>("已进入文件对话框线程");
|
||||
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));
|
||||
|
|
Loading…
Reference in New Issue