From c743485dad2ca83e12d16326afc9c319e3169f9a Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Tue, 19 Mar 2024 21:06:40 +0800 Subject: *misc --- ActiveRagdoll/Assets/TABG/Scripts/Player.cs | 106 ++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 ActiveRagdoll/Assets/TABG/Scripts/Player.cs (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Player.cs') diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Player.cs b/ActiveRagdoll/Assets/TABG/Scripts/Player.cs new file mode 100644 index 0000000..897d10f --- /dev/null +++ b/ActiveRagdoll/Assets/TABG/Scripts/Player.cs @@ -0,0 +1,106 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Rigging.Data; +using Rigging.Action; +using Rigging.Camera; +using System; +using Rigging.BodyPart; + +namespace Rigging +{ + + [Serializable] + public class Status + { + public StandingDataHandler standingData; + + public Gravity gravity; + + public MovementDataHandler movementData; + + public RigidbodyHolder body; + + public StepHandler step; + + public Strength strength; + } + + [Serializable] + public class Actions + { + public Standing standing; + public Movement movement; + public Balance balance; + public Knockback knockback; + public Rotation rotate; + } + + [Serializable] + public class BodyParts + { + public Rigging.BodyPart.Hip hip; + public Rigging.BodyPart.ArmLeft armLeft; + public Rigging.BodyPart.ArmRight armRight; + public Rigging.BodyPart.FootLeft footLeft; + public Rigging.BodyPart.FootRight footRight; + public Rigging.BodyPart.HandLeft handLeft; + public Rigging.BodyPart.HandRight handRight; + public Rigging.BodyPart.Head head; + public Rigging.BodyPart.KneeLeft kneeLeft; + public Rigging.BodyPart.KneeRight kneeRight; + public Rigging.BodyPart.LegLeft legLeft; + public Rigging.BodyPart.LegRight legRight; + public Rigging.BodyPart.Torso torso; + } + + public class Player : MonoBehaviour + { + + public GameObject rootArmature; + public GameObject rootRigidbody; + + // ½ÇÉ«µÄ״̬Êý¾Ý + public Status status; + + public Actions actions; + + public BodyParts body; + + private void Awake() + { + status = new Status(); + status.standingData = GetComponentInChildren(); + status.gravity = GetComponentInChildren(); + status.movementData = GetComponentInChildren(); + status.body = GetComponentInChildren(); + status.step = GetComponentInChildren(); + status.strength = GetComponentInChildren(); + + actions = new Actions(); + actions.standing = GetComponentInChildren(); + actions.movement = GetComponentInChildren(); + actions.balance = GetComponentInChildren(); + actions.knockback = GetComponentInChildren(); + actions.rotate = GetComponentInChildren(); + + body = new BodyParts(); + body.hip = GetComponentInChildren(); + body.armLeft = GetComponentInChildren(); + body.armRight = GetComponentInChildren(); + body.footLeft = GetComponentInChildren(); + body.footRight = GetComponentInChildren(); + body.handLeft = GetComponentInChildren(); + body.handRight = GetComponentInChildren(); + body.head = GetComponentInChildren(); + body.kneeLeft = GetComponentInChildren(); + body.kneeRight = GetComponentInChildren(); + body.legLeft = GetComponentInChildren(); + body.legRight = GetComponentInChildren(); + body.torso = GetComponentInChildren(); + + } + + } + +} -- cgit v1.1-26-g67d0