コード例 #1
0
 void Receive()
 {
     while (Connector.IsConnected)
     {
         try
         {
             // 受信データの解析処理
             IServerEvent serverEvent = parser.ReadAndParse(this);
             serverEventManager.AddEvent(serverEvent);
         }
         catch (Exception ex)
         {
             // 例外の内容に応じた処理を行う
             Debug.Log(ex.Message);
         }
     }
 }
コード例 #2
0
        async void Update()
        {
            Debug.Log($"${name}: ${cnt}");
            if (cnt >= 1)
            {
                UnityEngine.Debug.Log("2");
#if UNITY_EDITOR
                EditorApplication.isPlaying = false;
#elif UNITY_STANDALONE
                UnityEngine.Application.Quit();
#endif

                return;
            }

            isFirst = false;
            Debug.Log($"${name} th start");
            await Task.Run(A);

            Debug.Log($"${name} th end");
            cnt = cnt + 1;
        }