summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/ReactorRoomWire.cs
blob: 6f65fb9d84f273e87c6a1c72d9fc09e2717bf416 (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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
using PowerTools;
using UnityEngine;

public class ReactorRoomWire : MonoBehaviour
{
	public global::Console myConsole;

	public SpriteAnim Image;

	public AnimationClip Normal;

	public AnimationClip MeltdownNeed;

	public AnimationClip MeltdownReady;

	private ReactorSystemType reactor;

	public void Update()
	{
		if (this.reactor == null)
		{
			ISystemType systemType;
			if (!ShipStatus.Instance || !ShipStatus.Instance.Systems.TryGetValue(SystemTypes.Reactor, out systemType))
			{
				return;
			}
			this.reactor = (ReactorSystemType)systemType;
		}
		if (this.reactor.IsActive)
		{
			if (this.reactor.GetConsoleComplete(this.myConsole.ConsoleId))
			{
				if (!this.Image.IsPlaying(this.MeltdownReady))
				{
					this.Image.Play(this.MeltdownReady, 1f);
					return;
				}
			}
			else if (!this.Image.IsPlaying(this.MeltdownNeed))
			{
				this.Image.Play(this.MeltdownNeed, 1f);
				return;
			}
		}
		else if (!this.Image.IsPlaying(this.Normal))
		{
			this.Image.Play(this.Normal, 1f);
		}
	}
}