From 80983c575ec565078f757f638f3726708647080a Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Tue, 16 Apr 2024 11:08:04 +0800 Subject: *misc --- .../Assets/TABG/Scripts/Animation/DragHandler.cs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Animation/DragHandler.cs') 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(); + drag = rig.drag; + angularDrag = rig.angularDrag; + } + + private void Update() + { + rig.drag = drag * dragAmount; + rig.angularDrag = angularDrag * dragAmount; + } + } + +} -- cgit v1.1-26-g67d0