/// <summary> /// クライアントの準備完了を受信した /// </summary> /// <param name="Stream">ストリーム</param> /// <returns>レスポンスパケット</returns> private IPacket OnRecvClientReady(IDictionaryStream Stream) { var Request = new PacketClientReady(); Request.Serialize(Stream); // とりあえずダミーデータでも投げる var Id = Parent.ConnectionId; var Pos = new Vec3(1.0f, 0.0f, -3.0f); var Response = new PacketServerReady(Id, Pos); Parent.SetNextState(new GameStateActive(Parent)); return(Response); }
void Awake() { var ControlUIHandler = UIManager.Instance.Show <ControlInputs>("ControlInputs"); NetworkCore.Instance.SendRequest(new PacketClientReady(), EPacketID.ServerReady, (Stream) => { var Response = new PacketServerReady(); Response.Serialize(Stream); //var Id = Response.CharacterId; // TODO;PlayerManagerクラスを定義してそこに投げる var Pos = Response.Position.ToVector3(); var SpawnPlayer = Player.Spawn(Pos); SpawnPlayer.SetupAsLocalPlayer(ControlUIHandler.Instance.MoveInput); }); }