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.
69 lines
2.0 KiB
69 lines
2.0 KiB
1 year ago
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
using UniRx;
|
||
|
|
||
|
public class SiameseConnectionCreationPanel : UIView
|
||
|
{
|
||
|
public Toggle PostToggle;
|
||
|
public Toggle FlushToggle;
|
||
|
public Toggle WallToggle;
|
||
|
public Toggle MultifunctionalToggle;
|
||
|
public Button SaveButton;
|
||
|
public Button ClearButton;
|
||
|
public override void Awake()
|
||
|
{
|
||
|
base.Awake();
|
||
|
//地上
|
||
|
PostToggle.OnValueChangedAsObservable()
|
||
|
.Subscribe(value =>
|
||
|
{
|
||
|
EquipmentManager.Instance.Clone("SBJHQA", value, 0f);
|
||
|
});
|
||
|
//地下
|
||
|
FlushToggle.OnValueChangedAsObservable()
|
||
|
.Subscribe(value =>
|
||
|
{
|
||
|
EquipmentManager.Instance.Clone("SBJHQB", value, 0f);
|
||
|
});
|
||
|
//墙壁式
|
||
|
WallToggle.OnValueChangedAsObservable()
|
||
|
.Subscribe(value =>
|
||
|
{
|
||
|
EquipmentManager.Instance.Clone("SBJHQC", value, 0f);
|
||
|
});
|
||
|
//多功能
|
||
|
MultifunctionalToggle.OnValueChangedAsObservable()
|
||
|
.Subscribe(value =>
|
||
|
{
|
||
|
EquipmentManager.Instance.Clone("SBJHQD", value, 0f);
|
||
|
});
|
||
|
//清空
|
||
|
ClearButton.OnClickAsObservable()
|
||
|
.Subscribe(_ => EquipmentManager.Instance.OnCleraButtonClicked());
|
||
|
//保存
|
||
|
SaveButton.OnClickAsObservable()
|
||
|
.Subscribe(_ => EquipmentManager.Instance.SaveData());
|
||
|
transform.Find("TitleBar/CloseButton").GetComponent<Button>().OnClickAsObservable()
|
||
|
.Subscribe(_ => Hide());
|
||
|
Observable.EveryLateUpdate()
|
||
|
.Where(_ => Input.GetMouseButtonDown(1))
|
||
|
.Subscribe(_ =>
|
||
|
{
|
||
|
PostToggle.isOn = false;
|
||
|
FlushToggle.isOn = false;
|
||
|
WallToggle.isOn = false;
|
||
|
MultifunctionalToggle.isOn = false;
|
||
|
});
|
||
|
}
|
||
|
|
||
|
|
||
|
public override void Hide()
|
||
|
{
|
||
|
base.Hide();
|
||
|
PostToggle.isOn = false;
|
||
|
FlushToggle.isOn = false;
|
||
|
WallToggle.isOn = false;
|
||
|
MultifunctionalToggle.isOn = false;
|
||
|
}
|
||
|
}
|