summaryrefslogtreecommitdiff
path: root/ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2024-04-16 11:08:04 +0800
committerchai <215380520@qq.com>2024-04-16 11:08:04 +0800
commit80983c575ec565078f757f638f3726708647080a (patch)
tree14cad7cf19d4670ecfba3f371e49540e0042155c /ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs
parent0464810f2f83c86560c3422d664380d474cb3e56 (diff)
*misc
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs')
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs33
1 files changed, 33 insertions, 0 deletions
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs b/ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs
new file mode 100644
index 0000000..7528f57
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs
@@ -0,0 +1,33 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+namespace Rigging.Animations
+{
+
+ public class DragHandler : MonoBehaviour
+ {
+
+ private float drag;
+
+ private float angularDrag;
+
+ private Rigidbody rig;
+
+ public float dragAmount = 1f;
+
+ private void Start()
+ {
+ rig = GetComponent<Rigidbody>();
+ drag = rig.drag;
+ angularDrag = rig.angularDrag;
+ }
+
+ private void Update()
+ {
+ rig.drag = drag * dragAmount;
+ rig.angularDrag = angularDrag * dragAmount;
+ }
+ }
+
+}