public void SyncHandDown(SMessageHand _data) { if (_data.ownerClientID == NetworkManager.Instance.GetClientID()) { return; } if (_data.handType == 0) { leftHand.position = _data.position; leftHand.rotation = _data.rotation; foreach (var bone in _data.bones) { if (leftHandBones.ContainsKey(bone.name)) { leftHandBones[bone.name].transform.rotation = bone.rotation; } } } if (_data.handType == 1) { rightHand.position = _data.position; rightHand.rotation = _data.rotation; foreach (var bone in _data.bones) { if (rightHandBones.ContainsKey(bone.name)) { rightHandBones[bone.name].transform.rotation = bone.rotation; } } } }
private SMessageHand CreateMessageForHand(int _type) { SMessageHand message = new SMessageHand(_type, new List <SBone>(), _type == 0 ? leftHand.position : rightHand.position, _type == 0 ? leftHand.rotation : rightHand.rotation); message.ownerClientID = NetworkManager.Instance.GetClientID(); foreach (var bone in _type == 0 ? leftHandBones : rightHandBones) { message.bones.Add(new SBone(bone.Key, bone.Value.rotation)); } return(message); }
public void SyncHandsDown(SMessageHand _message) { otherPlayerHands.SyncHandDown(_message); }