You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
2.2 KiB
71 lines
2.2 KiB
using AX.MessageSystem; |
|
using System; |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using UnityEngine.UI; |
|
|
|
public class StorageTankSystemUI : ResourceLoadPanel<StorageTankSystemUI> |
|
{ |
|
public Toggle WaterSpraySystemToggle; |
|
public Toggle FrothGeneratorToggle; |
|
public Button ConfirmButton; |
|
private Action EStorageTankSystem; |
|
List<StorageTankSystemRecordData> Data = new List<StorageTankSystemRecordData>(); |
|
void Awake() |
|
{ |
|
WaterSpraySystemToggle.onValueChanged.AddListener(WaterSpraySystem); |
|
FrothGeneratorToggle.onValueChanged.AddListener(FrothGenerator); |
|
ConfirmButton.onClick.AddListener(Confirm); |
|
EStorageTankSystem += () => |
|
{ |
|
foreach (var item in Data) |
|
{ |
|
MessageDispatcher.SendMessage("StorageTankSystemSwitch", item); |
|
} |
|
}; |
|
} |
|
private void OnDestroy() |
|
{ |
|
} |
|
private void Confirm() |
|
{ |
|
gameObject.SetActive(false); |
|
if (Data.Count != 0) |
|
{ |
|
EStorageTankSystem(); |
|
} |
|
Data.Clear(); |
|
} |
|
public void Show(OutFireSystem OutFireSystem) |
|
{ |
|
switch (OutFireSystem) |
|
{ |
|
case OutFireSystem.FrothGenerator: |
|
FrothGeneratorToggle.isOn = true; |
|
break; |
|
case OutFireSystem.WaterSpraySystem: |
|
WaterSpraySystemToggle.isOn = true; |
|
break; |
|
default: |
|
break; |
|
} |
|
} |
|
StorageTankSystemRecordData WaterSpraySystemdata=new StorageTankSystemRecordData(); |
|
private void WaterSpraySystem(bool arg0) |
|
{ |
|
if (!Data.Contains(WaterSpraySystemdata)) |
|
Data.Add(WaterSpraySystemdata); |
|
WaterSpraySystemdata.OutFireSystem = OutFireSystem.WaterSpraySystem; |
|
WaterSpraySystemdata.Switch = arg0; |
|
} |
|
StorageTankSystemRecordData FrothGeneratordata=new StorageTankSystemRecordData(); |
|
private void FrothGenerator(bool arg0) |
|
{ |
|
if (!Data.Contains(FrothGeneratordata)) |
|
Data.Add(FrothGeneratordata); |
|
FrothGeneratordata.OutFireSystem = OutFireSystem.FrothGenerator; |
|
FrothGeneratordata.Switch = arg0; |
|
} |
|
|
|
}
|
|
|