Exemplo n.º 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);
            }
        }
Exemplo n.º 2
0
        public static void Init(string playerUID)
        {
            if (Instance != null)
            {
                return;
            }

            _debugMode = false;
            Instance   = new FrameSyncClient(playerUID);
            UnityThread.initUnityThread();

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