summaryrefslogtreecommitdiff
path: root/ActiveRagdoll/Assets/TABG/Scripts
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2024-03-19 21:06:40 +0800
committerchai <215380520@qq.com>2024-03-19 21:06:40 +0800
commitc743485dad2ca83e12d16326afc9c319e3169f9a (patch)
treebef7635defc8d48ffe64738a7ee598f43843f9c3 /ActiveRagdoll/Assets/TABG/Scripts
parent999a454764e91714847f531aee13903bfc31b0a9 (diff)
*misc
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts')
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs2
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Knockback.cs23
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Knockback.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs23
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/RiggingActionBase.cs47
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/RiggingActionBase.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Rotation.cs23
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Rotation.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Standing.cs25
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body.meta8
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/ArmLeft.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/ArmLeft.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/ArmRight.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/ArmRight.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/BodyPartBase.cs20
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/BodyPartBase.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/FootLeft.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/FootLeft.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/FootRight.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/FootRight.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/HandLeft.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/HandLeft.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/HandRight.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/HandRight.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/Head.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/Head.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/Hip.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/Hip.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/KneeLeft.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/KneeLeft.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/KneeRight.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/KneeRight.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/LegLeft.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/LegLeft.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/LegRight.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/LegRight.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/Torso.cs17
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Body/Torso.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Camera.meta8
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Camera/CameraMovement.cs23
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Camera/CameraMovement.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/CollisionChecker.cs72
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/CollisionChecker.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/AnimationHandler.cs8
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/CharacterGearHandler.cs10
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/Gravity.cs2
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs2
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/RiggingDataBase.cs56
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/RiggingDataBase.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/RigidbodyHolder.cs11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/SetRigidbodySettings.cs2
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/StandingDataHandler.cs60
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs2
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/Strength.cs15
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Input.meta8
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs18
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Input/SetAnimationByInput.cs18
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Input/SetAnimationByInput.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Player.cs106
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Player.cs.meta11
62 files changed, 1036 insertions, 41 deletions
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs b/ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs
index 2319599..5456faf 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs
@@ -5,7 +5,7 @@ using UnityEngine;
namespace Rigging.Action
{
- public class Balance : MonoBehaviour
+ public class Balance : RiggingActionBase
{
public Rigidbody[] rigsToLift; //Head, Torso
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Knockback.cs b/ActiveRagdoll/Assets/TABG/Scripts/Action/Knockback.cs
new file mode 100644
index 0000000..b49e1e5
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Knockback.cs
@@ -0,0 +1,23 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rigging.Action
+{
+
+ public class Knockback : RiggingActionBase
+ {
+ // Start is called before the first frame update
+ void Start()
+ {
+
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Knockback.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Action/Knockback.cs.meta
new file mode 100644
index 0000000..c9a4aa1
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Knockback.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1fe5e09d4f747544988f3af4f3d00c6d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs b/ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs
new file mode 100644
index 0000000..47de9de
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs
@@ -0,0 +1,23 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rigging.Action
+{
+
+ public class Movement : RiggingActionBase
+ {
+ // Start is called before the first frame update
+ void Start()
+ {
+
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs.meta
new file mode 100644
index 0000000..1bcfda9
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: fa66a59fbdeb88241b1d0a4457980e08
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/RiggingActionBase.cs b/ActiveRagdoll/Assets/TABG/Scripts/Action/RiggingActionBase.cs
new file mode 100644
index 0000000..75adc53
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/RiggingActionBase.cs
@@ -0,0 +1,47 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rigging.Action
+{
+
+ public class RiggingActionBase : MonoBehaviour
+ {
+ protected Player player;
+
+ private void Awake()
+ {
+ player = GetComponentInParent<Player>();
+ OnAwake();
+ }
+
+ private void Update()
+ {
+ OnUpdate();
+ }
+
+ private void FixedUpdate()
+ {
+ OnFixedUpdate();
+ }
+
+ private void Start()
+ {
+ OnStart();
+ }
+
+ protected virtual void OnAwake()
+ {
+ }
+ protected virtual void OnUpdate()
+ {
+ }
+ protected virtual void OnFixedUpdate()
+ {
+ }
+ protected virtual void OnStart()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/RiggingActionBase.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Action/RiggingActionBase.cs.meta
new file mode 100644
index 0000000..0c2700b
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/RiggingActionBase.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: bde6f3fc199d09e47a38a73cb6ce7ae9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Rotation.cs b/ActiveRagdoll/Assets/TABG/Scripts/Action/Rotation.cs
new file mode 100644
index 0000000..9652670
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Rotation.cs
@@ -0,0 +1,23 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rigging.Action
+{
+
+ public class Rotation : RiggingActionBase
+ {
+ // Start is called before the first frame update
+ void Start()
+ {
+
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Rotation.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Action/Rotation.cs.meta
new file mode 100644
index 0000000..1596450
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Rotation.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 55df48472ee427144a26e74073837213
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Standing.cs b/ActiveRagdoll/Assets/TABG/Scripts/Action/Standing.cs
index 91365a4..dd9a62c 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Action/Standing.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Standing.cs
@@ -1,18 +1,19 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
+using UnityEngine.Windows;
namespace Rigging.Action
{
- public class Standing : MonoBehaviour
+ public class Standing : RiggingActionBase
{
public Rigidbody[] rigsToLift; //Head, Torso
public float force;
- private void FixedUpdate()
+ protected override void OnFixedUpdate()
{
foreach (var rig in rigsToLift)
{
@@ -20,6 +21,26 @@ namespace Rigging.Action
}
}
+
+ //private void Stand(AnimationCurve curve)
+ //{
+ // float num = 0f;
+ // if (input.isCrouching)
+ // {
+ // num = 0.35f;
+ // }
+ // float max = forceCapCurve.Evaluate(forceCapTime); // 力的上限
+ // RigidbodyMovment[] array = rigsToLift;
+ // foreach (RigidbodyMovment rigidbodyMovment in array)
+ // {
+ // // 施加一个向上的垂直向上的力,把角色吊起来
+ // Vector3 forceDir = Vector3.up;
+ // float forceMagnitude = standingMulti * muscleMultiplier * rigidbodyMovment.force * Mathf.Clamp(curve.Evaluate(standingData.distanceToGround / base.transform.localScale.x + num + offset + moveData.slopeVelocityStrenght * -0.2f), -100f, max);
+ // rigidbodyMovment.rig.AddForce(
+ // forceDir * forceMagnitude, ForceMode.Acceleration);
+ // }
+ //}
+
}
}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body.meta
new file mode 100644
index 0000000..0f980b0
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9a41e77f7b03f9545aefff5381422a09
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmLeft.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmLeft.cs
new file mode 100644
index 0000000..c8c70aa
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmLeft.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class ArmLeft : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmLeft.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmLeft.cs.meta
new file mode 100644
index 0000000..ac4f903
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmLeft.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9c9729c60c0c0324fae0eef3d1f7bbba
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmRight.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmRight.cs
new file mode 100644
index 0000000..555389c
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmRight.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class ArmRight : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmRight.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmRight.cs.meta
new file mode 100644
index 0000000..630b0ab
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/ArmRight.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 508e927201861d245bd51ceb5b18eefc
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/BodyPartBase.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/BodyPartBase.cs
new file mode 100644
index 0000000..dd65650
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/BodyPartBase.cs
@@ -0,0 +1,20 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+ public class BodyPartBase : MonoBehaviour
+ {
+
+ public Rigidbody rigidbody;
+
+ private void Awake()
+ {
+ rigidbody = GetComponent<Rigidbody>();
+ rigidbody.sleepThreshold = 0;
+ }
+
+ }
+
+}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/BodyPartBase.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/BodyPartBase.cs.meta
new file mode 100644
index 0000000..d06c038
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/BodyPartBase.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ccc89c63c2f0a84479798d19b530fcdb
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/FootLeft.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/FootLeft.cs
new file mode 100644
index 0000000..0a42c87
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/FootLeft.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class FootLeft : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/FootLeft.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/FootLeft.cs.meta
new file mode 100644
index 0000000..ccb9a42
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/FootLeft.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 81776d0149c84094eb151eb8cd90e148
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/FootRight.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/FootRight.cs
new file mode 100644
index 0000000..306b551
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/FootRight.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class FootRight : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/FootRight.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/FootRight.cs.meta
new file mode 100644
index 0000000..b016566
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/FootRight.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b0f204a40a6fa0844bd4ad08985a3824
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/HandLeft.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/HandLeft.cs
new file mode 100644
index 0000000..cdb2862
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/HandLeft.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class HandLeft : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/HandLeft.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/HandLeft.cs.meta
new file mode 100644
index 0000000..223ebf5
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/HandLeft.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: af25fb620b16ea04384efa2ca29c08d6
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/HandRight.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/HandRight.cs
new file mode 100644
index 0000000..3a547b2
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/HandRight.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class HandRight : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/HandRight.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/HandRight.cs.meta
new file mode 100644
index 0000000..09ca1d0
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/HandRight.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 343ebe5625328c6489d85d551955d402
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/Head.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/Head.cs
new file mode 100644
index 0000000..807c72d
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/Head.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+ public class Head : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/Head.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/Head.cs.meta
new file mode 100644
index 0000000..76d61d1
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/Head.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b3a5fbc4ef0e67544a940cd268ecffba
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/Hip.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/Hip.cs
new file mode 100644
index 0000000..00e9dde
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/Hip.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class Hip : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/Hip.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/Hip.cs.meta
new file mode 100644
index 0000000..5a9290b
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/Hip.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9e375330714645c4988cf20aecc99c48
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeLeft.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeLeft.cs
new file mode 100644
index 0000000..de292ec
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeLeft.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class KneeLeft : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeLeft.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeLeft.cs.meta
new file mode 100644
index 0000000..628c5cb
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeLeft.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: b869fc9e68992dd4190cf5ed40e60044
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeRight.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeRight.cs
new file mode 100644
index 0000000..d3201b9
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeRight.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class KneeRight : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeRight.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeRight.cs.meta
new file mode 100644
index 0000000..c36bca0
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/KneeRight.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 743bb0295fc2b644c80f0e83a9d1f777
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/LegLeft.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/LegLeft.cs
new file mode 100644
index 0000000..17c0841
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/LegLeft.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class LegLeft : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/LegLeft.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/LegLeft.cs.meta
new file mode 100644
index 0000000..afaa546
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/LegLeft.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5df966c9f2b1ed54fbcf55ea8f03380b
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/LegRight.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/LegRight.cs
new file mode 100644
index 0000000..77281a1
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/LegRight.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class LegRight : MonoBehaviour
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/LegRight.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/LegRight.cs.meta
new file mode 100644
index 0000000..ab334af
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/LegRight.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 5e168c0b2976ea8459edfe49fecabfb9
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/Torso.cs b/ActiveRagdoll/Assets/TABG/Scripts/Body/Torso.cs
new file mode 100644
index 0000000..5328f57
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/Torso.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Rigging.BodyPart
+{
+
+ public class Torso : BodyPartBase
+ {
+ private void Start()
+ {
+ }
+
+ private void Update()
+ {
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Body/Torso.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Body/Torso.cs.meta
new file mode 100644
index 0000000..770d5e9
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Body/Torso.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: cf0e7bf909bb4ff4ca0f30f91a28653d
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Camera.meta b/ActiveRagdoll/Assets/TABG/Scripts/Camera.meta
new file mode 100644
index 0000000..9255b32
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Camera.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cf9fc8e7b0f3af746a46260b1116b13c
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Camera/CameraMovement.cs b/ActiveRagdoll/Assets/TABG/Scripts/Camera/CameraMovement.cs
new file mode 100644
index 0000000..c988991
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Camera/CameraMovement.cs
@@ -0,0 +1,23 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rigging.Camera
+{
+
+ public class CameraMovement : MonoBehaviour
+ {
+ // Start is called before the first frame update
+ void Start()
+ {
+
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+
+ }
+ }
+
+} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Camera/CameraMovement.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Camera/CameraMovement.cs.meta
new file mode 100644
index 0000000..b023ac5
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Camera/CameraMovement.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 334643b75d265f8409ae1340eda60cba
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/CollisionChecker.cs b/ActiveRagdoll/Assets/TABG/Scripts/CollisionChecker.cs
new file mode 100644
index 0000000..75741ab
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/CollisionChecker.cs
@@ -0,0 +1,72 @@
+using Rigging.Data;
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rigging
+{
+
+ public class CollisionChecker : MonoBehaviour
+ {
+ public Player player;
+
+ private Transform head
+ {
+ get
+ {
+ return player.body.head.transform;
+ }
+ }
+
+ private Transform hip
+ {
+ get
+ {
+ return player.body.hip.transform;
+ }
+ }
+
+ private StandingDataHandler data;
+
+ public bool active = true;
+
+ public float sinceGrounded = 0; // 离地开始算的时间
+
+ public float allowedSteepnesAngle = 60f;
+
+ private void Start()
+ {
+ player = GetComponentInParent<Player>();
+
+ data = player.status.standingData;
+ }
+
+ private void Update()
+ {
+ sinceGrounded += Time.deltaTime;
+ }
+
+ private void OnCollisionStay(Collision collision)
+ {
+ Collide(collision);
+ }
+
+ private void OnCollisionEnter(Collision collision)
+ {
+ Collide(collision);
+ }
+
+ private void Collide(Collision collision)
+ {
+ if (active && Vector3.Angle(Vector3.up, collision.contacts[0].normal) < allowedSteepnesAngle)
+ {
+ if ((bool)data)
+ {
+ data.TouchGround(Mathf.Abs(hip.position.y - collision.contacts[0].point.y), collision.contacts[0].normal);
+ }
+ sinceGrounded = 0f;
+ }
+ }
+ }
+
+}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/CollisionChecker.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/CollisionChecker.cs.meta
new file mode 100644
index 0000000..f89102f
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/CollisionChecker.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: dd9e48ab223f3c6438a6da67b72efb5e
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/AnimationHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/AnimationHandler.cs
index bc20e7c..2d051bf 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/AnimationHandler.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/AnimationHandler.cs
@@ -5,12 +5,18 @@ using UnityEngine;
namespace Rigging.Data
{
- public class AnimationHandler : MonoBehaviour
+ public class AnimationHandler : RiggingDataBase
{
+ protected override void OnStart()
+ {
+ base.OnStart();
+ }
+
+
}
}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/CharacterGearHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/CharacterGearHandler.cs
index 7490043..95ef268 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/CharacterGearHandler.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/CharacterGearHandler.cs
@@ -5,19 +5,11 @@ using UnityEngine;
namespace Rigging.Data
{
- public class CharacterGearHandler : MonoBehaviour
+ public class CharacterGearHandler : RiggingDataBase
{
- // Start is called before the first frame update
- void Start()
- {
- }
- // Update is called once per frame
- void Update()
- {
- }
}
} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/Gravity.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/Gravity.cs
index f087185..2e24f81 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/Gravity.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/Gravity.cs
@@ -5,7 +5,7 @@ using UnityEngine;
namespace Rigging.Data
{
- public class Gravity : MonoBehaviour
+ public class Gravity : RiggingDataBase
{
// Start is called before the first frame update
void Start()
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs
index ae3eb00..9a87817 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/MovementDataHandler.cs
@@ -4,7 +4,7 @@ using UnityEngine;
namespace Rigging.Data
{
- public class MovementDataHandler : MonoBehaviour
+ public class MovementDataHandler : RiggingDataBase
{
// Start is called before the first frame update
void Start()
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/RiggingDataBase.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/RiggingDataBase.cs
new file mode 100644
index 0000000..f304d5d
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/RiggingDataBase.cs
@@ -0,0 +1,56 @@
+using UnityEngine;
+
+namespace Rigging.Data
+{
+
+ public class RiggingDataBase : MonoBehaviour
+ {
+
+ protected Player player;
+
+ private void Awake()
+ {
+ player = GetComponentInParent<Player>();
+ OnAwake();
+ }
+
+ private void Update()
+ {
+ OnUpdate();
+ }
+
+ private void FixedUpdate()
+ {
+ OnFixedUpdate();
+ }
+
+ private void Start()
+ {
+ OnStart();
+ }
+
+ private void LateUpdate()
+ {
+ OnLateUpdate();
+ }
+
+ protected virtual void OnAwake()
+ {
+ }
+ protected virtual void OnUpdate()
+ {
+ }
+ protected virtual void OnFixedUpdate()
+ {
+ }
+ protected virtual void OnStart()
+ {
+ }
+
+ protected virtual void OnLateUpdate()
+ {
+ }
+
+ }
+
+}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/RiggingDataBase.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Data/RiggingDataBase.cs.meta
new file mode 100644
index 0000000..3544c82
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/RiggingDataBase.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 0a8f5353f5205904fb677c7c4c397460
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/RigidbodyHolder.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/RigidbodyHolder.cs
index ee3c350..eefa961 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/RigidbodyHolder.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/RigidbodyHolder.cs
@@ -5,16 +5,15 @@ namespace Rigging.Data
{
// 保存所有14个骨骼
- public class RigidbodyHolder : MonoBehaviour
- {
- public Rigidbody[] allRigs;
+ public class RigidbodyHolder : RiggingDataBase
+ {
+ public Transform rootBone;
- //private WeaponHandler weapons;
+ public Rigidbody[] allRigs;
private void Start()
{
- allRigs = GetComponentsInChildren<Rigidbody>();
- //weapons = GetComponent<WeaponHandler>();
+ allRigs = rootBone.gameObject.GetComponentsInChildren<Rigidbody>();
}
private void Update()
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/SetRigidbodySettings.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/SetRigidbodySettings.cs
index cb4b4e6..0af06c9 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/SetRigidbodySettings.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/SetRigidbodySettings.cs
@@ -5,7 +5,7 @@ using UnityEngine;
namespace Rigging.Data
{
- public class SetRigidbodySettings : MonoBehaviour
+ public class SetRigidbodySettings : RiggingDataBase
{
// Start is called before the first frame update
void Start()
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/StandingDataHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/StandingDataHandler.cs
index 588f089..6a4aeb2 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/StandingDataHandler.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/StandingDataHandler.cs
@@ -5,18 +5,64 @@ using UnityEngine;
namespace Rigging.Data
{
- public class StandingDataHandler : MonoBehaviour
+ public class StandingDataHandler : RiggingDataBase
{
- // Start is called before the first frame update
- void Start()
+
+ public float sinceGrounded; // 离地时间
+
+ public float sinceLanded;
+
+ public bool isGrounded;
+
+ public float distanceToGround = 1f;
+
+ private bool hasRecievedTouchedGround;
+
+ private MovementDataHandler movementData;
+
+ protected override void OnStart()
+ {
+ movementData = player.status.movementData;
+ }
+
+ protected override void OnFixedUpdate()
+ {
+ sinceGrounded += Time.fixedDeltaTime;
+ sinceLanded += Time.fixedDeltaTime;
+ if ((double)sinceGrounded > 0.1)
+ {
+ isGrounded = false;
+ }
+ }
+
+ protected override void OnLateUpdate()
+ {
+ hasRecievedTouchedGround = false;
+ }
+
+ public void TouchGround(float distance, Vector3 normal)
{
-
+ //if (sinceGrounded > 0.5f && (bool)wobbleShake)
+ //{
+ // wobbleShake.AddShake(-Vector3.up * 5f * Mathf.Pow(sinceGrounded, 1.5f), 0.8f);
+ //}
+ if (sinceGrounded > 0.5f)
+ {
+ Land(sinceGrounded);
+ }
+ sinceGrounded = 0f;
+ isGrounded = true;
+ if (distance > distanceToGround || !hasRecievedTouchedGround)
+ {
+ distanceToGround = distance;
+ }
+ hasRecievedTouchedGround = true;
+ //moveMentData.SetSlope(normal);
}
- // Update is called once per frame
- void Update()
+ private void Land(float landForce)
{
-
+ sinceLanded = 0f;
}
}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs
index cf178c5..032cf3f 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/StepHandler.cs
@@ -5,7 +5,7 @@ using UnityEngine;
namespace Rigging.Data
{
- public class StepHandler : MonoBehaviour
+ public class StepHandler : RiggingDataBase
{
// Start is called before the first frame update
void Start()
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/Strength.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/Strength.cs
index 6967953..b774c1a 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/Strength.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/Strength.cs
@@ -5,19 +5,12 @@ using UnityEngine;
namespace Rigging.Data
{
- public class Strength : MonoBehaviour
+ public class Strength : RiggingDataBase
{
- // Start is called before the first frame update
- void Start()
- {
-
- }
- // Update is called once per frame
- void Update()
- {
-
- }
+
+
+
}
} \ No newline at end of file
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Input.meta b/ActiveRagdoll/Assets/TABG/Scripts/Input.meta
new file mode 100644
index 0000000..d2f4aab
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Input.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 793d7d4f4582fe642876e55e09baaa6d
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs
new file mode 100644
index 0000000..bae645b
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs
@@ -0,0 +1,18 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class InputHandler : MonoBehaviour
+{
+ // Start is called before the first frame update
+ void Start()
+ {
+
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+
+ }
+}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs.meta
new file mode 100644
index 0000000..353adf4
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Input/InputHandler.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3e4f01fcb88b28040a13a524b623a670
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Input/SetAnimationByInput.cs b/ActiveRagdoll/Assets/TABG/Scripts/Input/SetAnimationByInput.cs
new file mode 100644
index 0000000..0f0feab
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Input/SetAnimationByInput.cs
@@ -0,0 +1,18 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class SetAnimationByInput : MonoBehaviour
+{
+ // Start is called before the first frame update
+ void Start()
+ {
+
+ }
+
+ // Update is called once per frame
+ void Update()
+ {
+
+ }
+}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Input/SetAnimationByInput.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Input/SetAnimationByInput.cs.meta
new file mode 100644
index 0000000..5f4a2de
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Input/SetAnimationByInput.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 01e4ef433b714c844acfa85d61aa6921
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
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>();
+
+ }
+
+ }
+
+}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Player.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Player.cs.meta
new file mode 100644
index 0000000..eda240a
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Player.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: ff9a3b3cfb35c564891de827e45f6bb1
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: