public override void SetUp() { engine.UpdateLogic.Subscribe(_ => { if (dictUsers.Count == 0) { return; } //req users updates RequestRPC rsp = new RequestRPC(); ReqUsersUpdate usersUpdate = new ReqUsersUpdate(); usersUpdate.Users.AddRange(dictUsers.Values); rsp.ReqUsersUpdate = usersUpdate; engine.server.Multicast(rsp.ToByteArray()); }); }
void RequestUserUpdate() { if (isPlayer) { RequestRPC reqRPC = new RequestRPC(); ReqUserUpdate req = new ReqUserUpdate(); var user = new User(); user.IsDead = isDead; user.X = birdX.transform.position.x; user.Y = transform.position.y; user.UserId = LSRequests.Instance.UserName.Value; req.User = user; reqRPC.ReqUserUpdate = req; ChatSever.client.SendAsync(reqRPC.ToByteArray()); } }