private void OnDeadReckoning(TransformSyncDataContainer trs) { VRRemotePlayer player = null; bool isContained = dicPlayer.TryGetValue(trs.ownerIndex, out player); if (isContained) { player.SetTransforms(trs.data); } }
protected IEnumerator CoEmitTransforms() { while (true) { yield return(new WaitForSeconds(0.1f)); var transforms = joints.Select(n => { var tr = new TransformSyncData(); n.GetPredictedTransforms(ref tr); return(tr); }).ToArray(); TransformSyncDataContainer container = new TransformSyncDataContainer(); container.data = transforms; container.ownerIndex = playerIndex; var jsonStr = JsonConvert.SerializeObject(container); JooNetManager.Instance.socket.Emit("deadReckoning", JSONObject.Create(jsonStr)); } }