summaryrefslogtreecommitdiff
path: root/ActiveRagdoll/Assets/TABG/Scripts/Animation
diff options
context:
space:
mode:
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Animation')
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Animation/AnimationObject.cs24
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Animation/FootHandler.cs18
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Animation/FootHandler.cs.meta11
3 files changed, 43 insertions, 10 deletions
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Animation/AnimationObject.cs b/ActiveRagdoll/Assets/TABG/Scripts/Animation/AnimationObject.cs
index 9e9039f..b7ef84a 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Animation/AnimationObject.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Animation/AnimationObject.cs
@@ -11,7 +11,7 @@ namespace Rigging.Animations
public class AnimationObject : MonoBehaviour
{
- public PhysicsAnimation[] animations;
+ public AnimationParam<PhysicsAnimation> animations;
private Rigidbody rig;
@@ -43,9 +43,9 @@ namespace Rigging.Animations
private void Start()
{
- animationHandler = base.transform.root.GetComponent<AnimationHandler>();
+ animationHandler = base.transform.root.GetComponentInChildren<AnimationHandler>();
rig = GetComponent<Rigidbody>();
- stepHandler = base.transform.root.GetComponent<StepHandler>();
+ stepHandler = base.transform.root.GetComponentInChildren<StepHandler>();
//holding = base.transform.root.GetComponent<Holding>();
//death = base.transform.root.GetComponent<PlayerDeath>();
Hip componentInChildren = base.transform.root.GetComponentInChildren<Hip>();
@@ -53,10 +53,14 @@ namespace Rigging.Animations
{
hip = componentInChildren.transform;
}
+
+ animations.SetPlayer(transform.root.GetComponent<Player>());
}
private void FixedUpdate()
{
+
+ return;
//if ((bool)death)
//{
// if (death.muscleFunction < 0f)
@@ -81,24 +85,24 @@ namespace Rigging.Animations
Vector3 vector = Vector3.zero;
if (isCurrentlyLeft == isLeft)
{
- Vector3 forwardForce = animations[animationHandler.animationState].forwardForce;
- if (animations[animationHandler.animationState].forceSpace == PhysicsAnimation.ForceSpace.World)
+ Vector3 forwardForce = animations.current.forwardForce;
+ if (animations.current.forceSpace == PhysicsAnimation.ForceSpace.World)
{
vector = forwardForce;
}
- if (animations[animationHandler.animationState].forceSpace == PhysicsAnimation.ForceSpace.Hip)
+ if (animations.current.forceSpace == PhysicsAnimation.ForceSpace.Hip)
{
vector = hip.TransformDirection(forwardForce);
}
}
else
{
- Vector3 backwardsForce = animations[animationHandler.animationState].backwardsForce;
- if (animations[animationHandler.animationState].forceSpace == PhysicsAnimation.ForceSpace.World)
+ Vector3 backwardsForce = animations.current.backwardsForce;
+ if (animations.current.forceSpace == PhysicsAnimation.ForceSpace.World)
{
vector = backwardsForce;
}
- if (animations[animationHandler.animationState].forceSpace == PhysicsAnimation.ForceSpace.Hip)
+ if (animations.current.forceSpace == PhysicsAnimation.ForceSpace.Hip)
{
vector = hip.TransformDirection(backwardsForce);
}
@@ -108,7 +112,7 @@ namespace Rigging.Animations
private void AddTorque()
{
- Vector3 vector = ((isCurrentlyLeft != isLeft) ? hip.TransformDirection(animations[animationHandler.animationState].backwardsTorque) : hip.TransformDirection(animations[animationHandler.animationState].forwardTorque));
+ Vector3 vector = ((isCurrentlyLeft != isLeft) ? hip.TransformDirection(animations.current.backwardsTorque) : hip.TransformDirection(animations.current.forwardTorque));
rig.AddTorque(vector * muscleMultiplier * multiplier, ForceMode.Acceleration);
}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Animation/FootHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Animation/FootHandler.cs
new file mode 100644
index 0000000..44516ea
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Animation/FootHandler.cs
@@ -0,0 +1,18 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class FootHandler : 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/Animation/FootHandler.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Animation/FootHandler.cs.meta
new file mode 100644
index 0000000..639fe22
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Animation/FootHandler.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 00a1a832fd188784190ab7eba313d3a0
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant: