소스 검색

Make ThreadingHelper run before other scripts

ManlyMarco 5 년 전
부모
커밋
503e39675f
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      BepInEx/ThreadingHelper.cs

+ 2 - 0
BepInEx/ThreadingHelper.cs

@@ -10,6 +10,7 @@ namespace BepInEx
 	/// <summary>
 	/// Provides methods for running code on other threads and synchronizing with the main thread.
 	/// </summary>
+	[DefaultExecutionOrder(int.MinValue)]
 	public sealed class ThreadingHelper : MonoBehaviour, ISynchronizeInvoke
 	{
 		private readonly object _invokeLock = new object();
@@ -47,6 +48,7 @@ namespace BepInEx
 
 		private void Update()
 		{
+			// The CurrentThread can change between Awake and later methods, it's safest to get it here.
 			if (_mainThread == null)
 				_mainThread = Thread.CurrentThread;