using System.Collections; using System.Collections.Generic; using UnityEngine; using Rigging.Data; using Rigging.Action; using Rigging.Cameras; using System; using Rigging.BodyPart; using Rigging.Inputs; namespace Rigging { [Serializable] public class Status { public StandingDataHandler standingData; public Gravity gravity; public MovementDataHandler movementData; public RigidbodyHolder body; public StepHandler step; public Strength strength; public AnimationHandler animation; } [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; public Rigging.Inputs.InputHandler input; private void Awake() { status = new Status(); status.standingData = GetComponentInChildren(); status.gravity = GetComponentInChildren(); status.movementData = GetComponentInChildren(); status.body = GetComponentInChildren(); status.step = GetComponentInChildren(); status.strength = GetComponentInChildren(); status.animation = 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(); input = GetComponent(); } } }