public static void Initialize() { #if DEBUG // Instead of silently skipping, ensure we have predictable control over initialization and shutdown sequence. if (Initialized) { throw new InvalidOperationException("DotsRuntime.Initialize() already called"); } Initialized = true; #endif JobsUtility.Initialize(); #if ENABLE_UNITY_COLLECTIONS_CHECKS JobNames.Initialize(); AtomicSafetyHandle.Initialize(); #endif #if UNITY_WEBGL try { HTMLNativeCalls.init(); } catch { Console.WriteLine(" Excepted (Is lib_unity_tiny2d_html.dll missing?)."); } #endif #if ENABLE_PLAYERCONNECTION Connection.Initialize(); Logger.Initialize(); #endif #if ENABLE_PROFILER Profiler.Initialize(); #endif #if UNITY_DOTSRUNTIME_IL2CPP_WAIT_FOR_MANAGED_DEBUGGER Connection.InitializeMulticast(); DebuggerAttachDialog.Show(Multicast.Broadcast); #endif InvokeEarlyInitMethods(); firstFrame = true; }