using System; using UnityEngine; public class InfectedOverlay : MonoBehaviour { public bool CanUseDoors { get { return !this.SabSystem.AnyActive; } } public bool CanUseSpecial { get { return this.SabSystem.Timer <= 0f && !this.doors.IsActive && !this.SabSystem.AnyActive; } } public MapRoom[] rooms; private IActivatable doors; private SabotageSystemType SabSystem; public void Start() { for (int i = 0; i < this.rooms.Length; i++) { this.rooms[i].Parent = this; } this.SabSystem = (SabotageSystemType)ShipStatus.Instance.Systems[SystemTypes.Sabotage]; this.doors = (IActivatable)ShipStatus.Instance.Systems[SystemTypes.Doors]; } private void FixedUpdate() { if (this.doors == null) { return; } float specialActive = this.doors.IsActive ? 1f : this.SabSystem.PercentCool; for (int i = 0; i < this.rooms.Length; i++) { this.rooms[i].SetSpecialActive(specialActive); this.rooms[i].OOBUpdate(); } } }