public static void AttachParachute(Contexts contexts, PlayerEntity player, bool isSyncRemote) { //服务器更新动画不更新骨骼数据,要用到骨骼数据,需要更新下骨骼数据 PlayerEntityUtility.UpdateAnimatorTransform(player); var transform = player.RootGo().transform; var parachute = player.playerSkyMove.Parachute; var anchor = player.playerSkyMove.ParachuteAnchor; if (parachute != null && !player.playerSkyMove.IsParachuteAttached) { _logger.InfoFormat("SKyDive : Attach Patachute To Parachuting State"); if (!isSyncRemote) { var position = transform.position; parachute.SetPositionAndRotation(transform.position, transform.rotation); var target = player.thirdPersonModel.Value.transform.FindChildRecursively(BoneName.CharacterRightHandName); BoneMount.FixedObj2Bones(transform.gameObject, target, anchor); parachute.position += position - transform.position; player.playerSkyMove.Position = parachute.transform.position; player.playerSkyMove.Rotation = parachute.transform.rotation; player.playerSkyMove.MoveStage = (int)SkyMoveStage.Parachuting; player.playerSkyMove.LocalPlayerPosition = transform.localPosition; player.playerSkyMove.LocalPlayerRotation = transform.localRotation; } else { transform.parent = anchor; player.playerSkyMove.Parachute.position = player.playerSkyMove.Position; player.playerSkyMove.Parachute.rotation = player.playerSkyMove.Rotation; transform.localPosition = player.playerSkyMove.LocalPlayerPosition; transform.localRotation = player.playerSkyMove.LocalPlayerRotation; } player.playerSkyMove.IsParachuteAttached = true; player.playerSkyMove.IsWaitForAttach = false; parachute.gameObject.SetActive(true); } }