From e9ea621b93fbb58d9edfca8375918791637bbd52 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 30 Dec 2020 20:59:04 +0800 Subject: +init --- Client/Assembly-CSharp/TumbleBoxBehaviour.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Client/Assembly-CSharp/TumbleBoxBehaviour.cs (limited to 'Client/Assembly-CSharp/TumbleBoxBehaviour.cs') diff --git a/Client/Assembly-CSharp/TumbleBoxBehaviour.cs b/Client/Assembly-CSharp/TumbleBoxBehaviour.cs new file mode 100644 index 0000000..8d9f722 --- /dev/null +++ b/Client/Assembly-CSharp/TumbleBoxBehaviour.cs @@ -0,0 +1,24 @@ +using System; +using UnityEngine; + +public class TumbleBoxBehaviour : MonoBehaviour +{ + public FloatRange BoxHeight; + + public FloatRange shadowScale; + + public SpriteRenderer Shadow; + + public SpriteRenderer Box; + + public void FixedUpdate() + { + float z = Time.time * 15f; + float v = Mathf.Cos(Time.time * 3.1415927f / 10f) / 2f + 0.5f; + float num = this.shadowScale.Lerp(v); + this.Shadow.transform.localScale = new Vector3(num, num, num); + float y = this.BoxHeight.Lerp(v); + this.Box.transform.localPosition = new Vector3(0f, y, -0.01f); + this.Box.transform.eulerAngles = new Vector3(0f, 0f, z); + } +} -- cgit v1.1-26-g67d0