From ddb79ab0eb05485843037783926e7579f75f2760 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sat, 17 Sep 2022 16:36:20 +0800 Subject: [PATCH] NetworkLoop: remove old Unity 2018 code --- Assets/Mirror/Runtime/NetworkLoop.cs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkLoop.cs b/Assets/Mirror/Runtime/NetworkLoop.cs index 9e133c32f..d341b4b1b 100644 --- a/Assets/Mirror/Runtime/NetworkLoop.cs +++ b/Assets/Mirror/Runtime/NetworkLoop.cs @@ -26,17 +26,8 @@ // to the beginning of PostLateUpdate doesn't actually work. using System; using UnityEngine; - -// PlayerLoop and LowLevel were in the Experimental namespace until 2019.3 -// https://docs.unity3d.com/2019.2/Documentation/ScriptReference/Experimental.LowLevel.PlayerLoop.html -// https://docs.unity3d.com/2019.3/Documentation/ScriptReference/LowLevel.PlayerLoop.html -#if UNITY_2019_3_OR_NEWER using UnityEngine.LowLevel; using UnityEngine.PlayerLoop; -#else -using UnityEngine.Experimental.LowLevel; -using UnityEngine.Experimental.PlayerLoop; -#endif namespace Mirror { @@ -45,7 +36,7 @@ public static class NetworkLoop // helper enum to add loop to begin/end of subSystemList internal enum AddMode { Beginning, End } - // callbacks in case someone needs to use early/lateupdate too. + // callbacks for others to hook into if they need Early/LateUpdate. public static Action OnEarlyUpdate; public static Action OnLateUpdate; @@ -166,12 +157,7 @@ static void RuntimeInitializeOnLoad() // 2019 has GetCURRENTPlayerLoop which is safe to use without // breaking other custom system's custom loops. // see also: https://github.com/vis2k/Mirror/pull/2627/files - PlayerLoopSystem playerLoop = -#if UNITY_2019_3_OR_NEWER - PlayerLoop.GetCurrentPlayerLoop(); -#else - PlayerLoop.GetDefaultPlayerLoop(); -#endif + PlayerLoopSystem playerLoop = PlayerLoop.GetCurrentPlayerLoop(); // add NetworkEarlyUpdate to the end of EarlyUpdate so it runs after // any Unity initializations but before the first Update/FixedUpdate