1
This commit is contained in:
@@ -13,6 +13,7 @@ using BITKit.Mod;
|
||||
|
||||
#if UNITY_64
|
||||
using System.Collections;
|
||||
using BITKit.UX;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using static BITKit.Mod.DotNetSdkRoslynService;
|
||||
@@ -60,6 +61,11 @@ namespace BITKit
|
||||
public static Assembly Compile(params string[] codes)
|
||||
{
|
||||
var outputPath = PathHelper.GetTempFilePath();
|
||||
|
||||
DI.TryGet<IUXWaiting>(out var waiting);
|
||||
|
||||
var handle = waiting?.Get();
|
||||
handle?.SetMessage("正在编译");
|
||||
try
|
||||
{
|
||||
if (Installed is false)
|
||||
@@ -126,6 +132,8 @@ namespace BITKit
|
||||
StandardInputEncoding = System.Text.Encoding.GetEncoding("gb2312"),
|
||||
StandardOutputEncoding = System.Text.Encoding.GetEncoding("gb2312"),
|
||||
};
|
||||
|
||||
|
||||
var process = new Process()
|
||||
{
|
||||
StartInfo = StartInfo,
|
||||
@@ -165,12 +173,14 @@ namespace BITKit
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
waiting?.Release(handle);
|
||||
|
||||
return Assembly.Load(bytes);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
waiting?.Release(handle);
|
||||
|
||||
throw new Exception($"编译失败:{e}");
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user