1
This commit is contained in:
@@ -87,6 +87,7 @@ namespace BITKit
|
||||
BuildinQueryServices = buildinQueryServices,
|
||||
RemoteServices = remoteServices
|
||||
};
|
||||
#if UNITY_EDITOR
|
||||
if (IsEditorSimulateMode)
|
||||
{
|
||||
|
||||
@@ -97,7 +98,9 @@ namespace BITKit
|
||||
EditorSimulateModeHelper.SimulateBuild("ScriptableBuildPipeline", packageName.Value)
|
||||
};
|
||||
initParameters = editorParameters;
|
||||
}else if (isOffline)
|
||||
}else
|
||||
#endif
|
||||
if (isOffline)
|
||||
{
|
||||
initParameters = new OfflinePlayModeParameters();
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ using UnityEngine.UIElements;
|
||||
|
||||
namespace BITKit.UX
|
||||
{
|
||||
#if !UNITY_WEBGL
|
||||
#if UNITY_64
|
||||
public class UXApplicationFile : MonoBehaviour
|
||||
{
|
||||
[SerializeReference, SubclassSelector] private IApplicationFile applicationFile;
|
||||
|
@@ -5,7 +5,9 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
#if UNITY_64
|
||||
using AnotherFileBrowser.Windows;
|
||||
#endif
|
||||
using BITKit.Mod;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
@@ -141,12 +143,16 @@ namespace BITKit.UX
|
||||
return;
|
||||
void OpenModInternal()
|
||||
{
|
||||
#if UNITY_64
|
||||
BIT4Log.Log<UXModService>("已进入文件对话框线程");
|
||||
new FileBrowser().OpenFileBrowser(new BrowserProperties()
|
||||
{
|
||||
//filterIndex = 0,
|
||||
//filter = "C Sharp files (*.cs)|*.cs |Dll files (*.dll)|*.dll",
|
||||
}, Filepath);
|
||||
#else
|
||||
throw new NotSupportedException($"{Application.platform} 不支持打开文件对话框");
|
||||
#endif
|
||||
return;
|
||||
async void Filepath(string path)
|
||||
{
|
||||
@@ -159,9 +165,13 @@ namespace BITKit.UX
|
||||
switch (file.Extension)
|
||||
{
|
||||
case ".cs":
|
||||
#if UNITY_64
|
||||
var code = await File.ReadAllTextAsync(path);
|
||||
var assembly = BITSharp.Compile(code);
|
||||
await ModService.Load(assembly,Path.GetDirectoryName(path));
|
||||
#else
|
||||
throw new NotSupportedException($"{Application.platform} 不支持编译C#代码");
|
||||
#endif
|
||||
break;
|
||||
case ".dll":
|
||||
var bytes = await File.ReadAllBytesAsync(path);
|
||||
|
@@ -22,6 +22,12 @@ namespace BITKit
|
||||
public class MonoBehaviorInspector : BITInspector<MonoBehaviour>
|
||||
{
|
||||
|
||||
}
|
||||
[CanEditMultipleObjects]
|
||||
[CustomEditor(typeof(ScriptableObject),true)]
|
||||
public class ScriptableObjectInspector : BITInspector<ScriptableObject>
|
||||
{
|
||||
|
||||
}
|
||||
[CustomPropertyDrawer(typeof(ReadOnlyAttribute),true)]
|
||||
public class ReadOnlyDrawer : PropertyDrawer
|
||||
|
@@ -3,14 +3,14 @@ using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
#if UNITY_64
|
||||
namespace BITKit.IO
|
||||
{
|
||||
public class UnityApplicationFile : MonoBehaviour
|
||||
{
|
||||
#if !UNITY_WEBGL
|
||||
|
||||
[SerializeReference,SubclassSelector] internal IApplicationFile service;
|
||||
#endif
|
||||
|
||||
}
|
||||
#if UNITY_EDITOR && !UNITY_WEBGL
|
||||
[CustomEditor(typeof(UnityApplicationFile))]
|
||||
@@ -49,4 +49,4 @@ namespace BITKit.IO
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using Quadtree;
|
||||
using Quadtree.Items;
|
||||
using UnityEngine;
|
||||
|
Reference in New Issue
Block a user