diff options
author | chai <215380520@qq.com> | 2024-03-19 21:06:40 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2024-03-19 21:06:40 +0800 |
commit | c743485dad2ca83e12d16326afc9c319e3169f9a (patch) | |
tree | bef7635defc8d48ffe64738a7ee598f43843f9c3 /ActiveRagdoll/Assets/TABG/Scripts/Player.cs | |
parent | 999a454764e91714847f531aee13903bfc31b0a9 (diff) |
*misc
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Player.cs')
-rw-r--r-- | ActiveRagdoll/Assets/TABG/Scripts/Player.cs | 106 |
1 files changed, 106 insertions, 0 deletions
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<StandingDataHandler>(); + status.gravity = GetComponentInChildren<Gravity>(); + status.movementData = GetComponentInChildren<MovementDataHandler>(); + status.body = GetComponentInChildren<RigidbodyHolder>(); + status.step = GetComponentInChildren<StepHandler>(); + status.strength = GetComponentInChildren<Strength>(); + + actions = new Actions(); + actions.standing = GetComponentInChildren<Standing>(); + actions.movement = GetComponentInChildren<Movement>(); + actions.balance = GetComponentInChildren<Balance>(); + actions.knockback = GetComponentInChildren<Knockback>(); + actions.rotate = GetComponentInChildren<Rotation>(); + + body = new BodyParts(); + body.hip = GetComponentInChildren<Rigging.BodyPart.Hip>(); + body.armLeft = GetComponentInChildren<Rigging.BodyPart.ArmLeft>(); + body.armRight = GetComponentInChildren<Rigging.BodyPart.ArmRight>(); + body.footLeft = GetComponentInChildren<Rigging.BodyPart.FootLeft>(); + body.footRight = GetComponentInChildren<Rigging.BodyPart.FootRight>(); + body.handLeft = GetComponentInChildren<Rigging.BodyPart.HandLeft>(); + body.handRight = GetComponentInChildren<Rigging.BodyPart.HandRight>(); + body.head = GetComponentInChildren<Rigging.BodyPart.Head>(); + body.kneeLeft = GetComponentInChildren<Rigging.BodyPart.KneeLeft>(); + body.kneeRight = GetComponentInChildren<Rigging.BodyPart.KneeRight>(); + body.legLeft = GetComponentInChildren<Rigging.BodyPart.LegLeft>(); + body.legRight = GetComponentInChildren<Rigging.BodyPart.LegRight>(); + body.torso = GetComponentInChildren<Rigging.BodyPart.Torso>(); + + } + + } + +} |