diff options
author | chai <chaifix@163.com> | 2020-12-30 20:59:04 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-12-30 20:59:04 +0800 |
commit | e9ea621b93fbb58d9edfca8375918791637bbd52 (patch) | |
tree | 19ce3b1c1f2d51eda6878c9d0f2c9edc27f13650 /Client/Assembly-CSharp/ReactorRoomWire.cs |
+init
Diffstat (limited to 'Client/Assembly-CSharp/ReactorRoomWire.cs')
-rw-r--r-- | Client/Assembly-CSharp/ReactorRoomWire.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Client/Assembly-CSharp/ReactorRoomWire.cs b/Client/Assembly-CSharp/ReactorRoomWire.cs new file mode 100644 index 0000000..6f65fb9 --- /dev/null +++ b/Client/Assembly-CSharp/ReactorRoomWire.cs @@ -0,0 +1,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); + } + } +} |