summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/ChainBehaviour.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assembly-CSharp/ChainBehaviour.cs')
-rw-r--r--Client/Assembly-CSharp/ChainBehaviour.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/Client/Assembly-CSharp/ChainBehaviour.cs b/Client/Assembly-CSharp/ChainBehaviour.cs
new file mode 100644
index 0000000..38a5da5
--- /dev/null
+++ b/Client/Assembly-CSharp/ChainBehaviour.cs
@@ -0,0 +1,27 @@
+using System;
+using UnityEngine;
+
+public class ChainBehaviour : MonoBehaviour
+{
+ public FloatRange SwingRange = new FloatRange(0f, 30f);
+
+ public float SwingPeriod = 2f;
+
+ public float swingTime;
+
+ private Vector3 vec;
+
+ public void Awake()
+ {
+ this.swingTime = FloatRange.Next(0f, this.SwingPeriod);
+ this.vec.z = this.SwingRange.Lerp(Mathf.Sin(this.swingTime));
+ base.transform.eulerAngles = this.vec;
+ }
+
+ public void Update()
+ {
+ this.swingTime += Time.deltaTime / this.SwingPeriod;
+ this.vec.z = this.SwingRange.Lerp(Mathf.Sin(this.swingTime * 3.1415927f) / 2f + 0.5f);
+ base.transform.eulerAngles = this.vec;
+ }
+}