Exemplo n.º 1
0
        private IEnumerator MoveToNextFrame()
        {
            // 自分のactionの送信
            int          currentFrame = Time.frameCount - startFrame;
            IClientEvent ev           = CreateActionEvent(currentFrame);

            tcpClient.Send(ev);
            yield return(null);

            // 他プレイヤーの行動待機
            int lagCounter = 0;

            while (currentFrame > latestFrame)
            {
                if (lagCounter++ % 60 != 0)
                {
                    break;
                }
                serverEventManager.CallEvents();
            }

            game.UpdateGame(this, ActionBuffers);
        }