blob: 60889013b712e55c9e57a7add717e3d42b4774bf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
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<StandingDataHandler>();
status.gravity = GetComponentInChildren<Gravity>();
status.movementData = GetComponentInChildren<MovementDataHandler>();
status.body = GetComponentInChildren<RigidbodyHolder>();
status.step = GetComponentInChildren<StepHandler>();
status.strength = GetComponentInChildren<Strength>();
status.animation = GetComponentInChildren<AnimationHandler>();
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>();
input = GetComponent<Rigging.Inputs.InputHandler>();
}
}
}
|