summaryrefslogtreecommitdiff
path: root/Thronefall_1_57/Decompile/Thronefall/QuickslingBarrelRotator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Thronefall_1_57/Decompile/Thronefall/QuickslingBarrelRotator.cs')
-rw-r--r--Thronefall_1_57/Decompile/Thronefall/QuickslingBarrelRotator.cs40
1 files changed, 0 insertions, 40 deletions
diff --git a/Thronefall_1_57/Decompile/Thronefall/QuickslingBarrelRotator.cs b/Thronefall_1_57/Decompile/Thronefall/QuickslingBarrelRotator.cs
deleted file mode 100644
index 693df38..0000000
--- a/Thronefall_1_57/Decompile/Thronefall/QuickslingBarrelRotator.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using UnityEngine;
-
-public class QuickslingBarrelRotator : MonoBehaviour
-{
- public Transform transformToRotate;
-
- public AutoAttack attack;
-
- public float attackSmoothTime = 0.05f;
-
- private Vector3 desiredForward;
-
- private Vector3 angularVelocityRef;
-
- private float minSqVelocity = 1.5f;
-
- private void Start()
- {
- if ((bool)attack)
- {
- attack.onAttackTriggered.AddListener(OnAttack);
- }
- desiredForward = transformToRotate.forward;
- }
-
- private void Update()
- {
- if (Vector3.Angle(transformToRotate.forward, desiredForward) > 3f)
- {
- transformToRotate.forward = Vector3.SmoothDamp(transformToRotate.forward, desiredForward, ref angularVelocityRef, attackSmoothTime);
- }
- }
-
- private void OnAttack()
- {
- desiredForward = attack.LastTargetPosition - transformToRotate.position;
- desiredForward.y = 0f;
- desiredForward.Normalize();
- }
-}