41 lines
2.1 KiB
C#
41 lines
2.1 KiB
C#
// WL_ForceCompile.cs — Assembly-CSharp 를 강제로 다시 컴파일한다(디스크 DLL 자체가 낡았을 때).
|
|
// unity command run_script --file AgentScripts/WL_ForceCompile.cs --entry WL_ForceCompile.Go
|
|
// unity command run_script --file AgentScripts/WL_ForceCompile.cs --entry WL_ForceCompile.Check
|
|
using System.Linq;
|
|
using System.Text;
|
|
using UnityEditor;
|
|
using UnityEditor.Compilation;
|
|
|
|
public static class WL_ForceCompile
|
|
{
|
|
public static object Go()
|
|
{
|
|
if (EditorApplication.isPlaying) return "ABORT: Play 중";
|
|
AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport | ImportAssetOptions.ForceUpdate);
|
|
CompilationPipeline.RequestScriptCompilation(RequestScriptCompilationOptions.CleanBuildCache);
|
|
return "requested clean script compilation";
|
|
}
|
|
|
|
/// <summary>새 타입·새 멤버가 실제로 어셈블리에 들어왔는지 확인.</summary>
|
|
public static object Check()
|
|
{
|
|
var sb = new StringBuilder();
|
|
var t = System.AppDomain.CurrentDomain.GetAssemblies()
|
|
.Select(a => a.GetType("WL.UI.BottomBarFitter")).FirstOrDefault(x => x != null);
|
|
sb.AppendLine("BottomBarFitter = " + (t != null ? t.AssemblyQualifiedName : "(없음)"));
|
|
|
|
var ov = System.AppDomain.CurrentDomain.GetAssemblies()
|
|
.Select(a => a.GetType("WL.UI.WLIngameUiOverride")).FirstOrDefault(x => x != null);
|
|
if (ov != null)
|
|
{
|
|
var m = ov.GetMethod("ApplyCanvasGroupHide", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static);
|
|
sb.AppendLine("WLIngameUiOverride.ApplyCanvasGroupHide = " + (m != null ? "있음" : "(없음 · 낡은 어셈블리)"));
|
|
}
|
|
var st = System.AppDomain.CurrentDomain.GetAssemblies()
|
|
.Select(a => a.GetType("WL.Settings.WLGameplaySettings")).FirstOrDefault(x => x != null);
|
|
if (st != null)
|
|
sb.AppendLine("WLGameplaySettings.hideIngameChat = " + (st.GetField("hideIngameChat") != null ? "있음" : "(없음 · 낡은 어셈블리)"));
|
|
return sb.ToString();
|
|
}
|
|
}
|