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/SteamBehaviour.cs | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Client/Assembly-CSharp/SteamBehaviour.cs (limited to 'Client/Assembly-CSharp/SteamBehaviour.cs') diff --git a/Client/Assembly-CSharp/SteamBehaviour.cs b/Client/Assembly-CSharp/SteamBehaviour.cs new file mode 100644 index 0000000..515d641 --- /dev/null +++ b/Client/Assembly-CSharp/SteamBehaviour.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections; +using PowerTools; +using UnityEngine; + +public class SteamBehaviour : MonoBehaviour +{ + public SpriteAnim anim; + + public FloatRange PlayRate = new FloatRange(0.5f, 1f); + + public void OnEnable() + { + base.StartCoroutine(this.Run()); + } + + private IEnumerator Run() + { + for (;;) + { + float time = this.PlayRate.Next(); + while (time > 0f) + { + time -= Time.deltaTime; + yield return null; + } + this.anim.Play(null, 1f); + while (this.anim.IsPlaying(null)) + { + yield return null; + } + } + yield break; + } +} -- cgit v1.1-26-g67d0