summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/SteamBehaviour.cs
blob: 515d6419270256b4f9273db87e059e6ea2505567 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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;
	}
}