예제 #1
0
        public static void InitDebugMode(string playerUID, int playerCount)
        {
            if (Instance != null)
            {
                return;
            }

            if (playerCount < 1 || playerCount > 8)
            {
                Debug.LogError($"{_debugName}: invalid player count. (Max=8)");
                return;
            }

            _debugMode        = true;
            _debugPlayerCount = playerCount;
            Instance          = new FrameSyncClient(playerUID);
            UnityThread.initUnityThread();
            SWConsole.SetLogger(new UnityLogger());
            SWConsole.level = ConsoleLogLevel.error;

            if (UnityEngine.Application.isPlaying)
            {
                GameObject obj = new GameObject("_SWFrameSyncClientBehaviour");
                //obj.hideFlags = HideFlags.HideAndDontSave;
                SWFrameSyncClientBehaviour cb = obj.AddComponent <SWFrameSyncClientBehaviour>();
                cb.SetClient(Instance);
            }
        }