public void switchToAnimation() { if (!isRagdollMode) { return; } switchMode(false); act.rb.MovePosition(rbs[0].position - act.tfBody.localPosition); act.rb.MoveRotation(Quaternion.LookRotation(act.rb.rotation * Vector3.forward, Vector3.up)); tfBase.SetParent(act.tfBody, true); RagdollCliper.clipPose(tfBase, msClipPose.clip); act.playMotion(msClipPose); act.rb.isKinematic = false; act.rb.detectCollisions = true; act.tfBody.GetComponent <Animation>().enabled = true; }
void browing() { move.lerp(0.0f, 5.0f); if (migration.isLimitOver && isGround()) { state.changeTo(walk); //stay ); RagdollCliper.clipPose(tfHip, ragdoll.ms.clip); motion.play(ragdoll.ms); } output.loudness = 2.0f; }
void damaging() { move.lerp(0.0f, 2.0f); if (migration.isLimitOver) { state.changeTo(walk); //stay ); RagdollCliper.clipPose(tfCrotch, ragdoll.ms.clip); motion.play(ragdoll.ms); } output.loudness = 2.0f; }
public void switchToAnimation() { if (isRagdollMode) { act.tfObservedCenter = tfBodyHeadCenter; var tfWapon = act.playerShoot.weapons.current.tf; tfWapon.parent = tfBodyHand; tfWapon.localPosition = Vector3.zero; tfWapon.localRotation = Quaternion.identity; tfRagdollBase.gameObject.SetActive(false); tfBodyBase.gameObject.SetActive(true); act.activateCollider(true); act.rb.isKinematic = false; smr.switchBones(tfBodyParts); act.rb.MovePosition(tfRagdollBase.position - act.tfBody.localPosition); act.rb.MoveRotation(Quaternion.LookRotation(act.rb.rotation * Vector3.forward, Vector3.up)); RagdollCliper.clipPose(tfRagdollBase, msRagdoll.clip); act.playMotion(msRagdoll); /* * for( var i = 1; i < tfBodyParts.Length; i++ ) * { * * var tfBodyPart = tfBodyParts[i]; * * var tfRagdollPart = tfRagdollParts[i]; * * tfBodyPart.localPosition = tfRagdollPart.localPosition; * * tfBodyPart.localRotation = tfRagdollPart.localRotation; * * } * * tfBodyBase.position = tfRagdollBase.position; * * tfBodyBase.rotation = tfRagdollBase.rotation; * * * //act.playMotion( ragMotion.getNowPosing() ); * * //switchObservedCenter(); */ } }