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.
61 lines
2.2 KiB
61 lines
2.2 KiB
1 year ago
|
using UniRx;
|
||
|
using UnityEngine;
|
||
|
using UnityEngine.UI;
|
||
|
|
||
|
public class LinkageFoceConfigPanel : UIView
|
||
|
{
|
||
|
public GameObject Item;
|
||
|
public Button DelButton;
|
||
|
public Button SetButton;
|
||
|
public Button CloseButton;
|
||
|
|
||
|
public InputField BMInput;
|
||
|
public InputField MCInput;
|
||
|
public InputField DZInput;
|
||
|
public InputField DHInput;
|
||
|
public InputField LLInput;
|
||
|
public InputField RWInput;
|
||
|
public override void Awake()
|
||
|
{
|
||
|
base.Awake();
|
||
|
DelButton = Find<Button>("Bottom Variant/DefaultPanel/DeleteButton");
|
||
|
SetButton = Find<Button>("Bottom Variant/DefaultPanel/SetButton");
|
||
|
CloseButton = Find<Button>("TitleBar/CloseButton");
|
||
|
|
||
|
BMInput = Find<InputField>("Background/InfoBackground/EditInfoPanel/BMInput");
|
||
|
MCInput = Find<InputField>("Background/InfoBackground/EditInfoPanel/MCInput");
|
||
|
DZInput = Find<InputField>("Background/InfoBackground/EditInfoPanel/DZInput");
|
||
|
DHInput = Find<InputField>("Background/InfoBackground/EditInfoPanel/DHInput");
|
||
|
LLInput = Find<InputField>("Background/InfoBackground/EditInfoPanel/LLInput");
|
||
|
RWInput = Find<InputField>("Background/InfoBackground/EditInfoPanel/RWInput");
|
||
|
|
||
|
CloseButton.OnClickAsObservable()
|
||
|
.Subscribe(_ => Hide());
|
||
|
|
||
|
|
||
|
DelButton.OnClickAsObservable()
|
||
|
.Subscribe(_ =>
|
||
|
{
|
||
|
var data = UIManager.Instance.GetView<LinkageForceTablePanel>().Data;
|
||
|
data.Forces.Remove(data.Forces.Find(a => a.Id == Item.name));
|
||
|
Destroy(Item);
|
||
|
Hide();
|
||
|
});
|
||
|
SetButton.OnClickAsObservable()
|
||
|
.Subscribe(_ => SetData());
|
||
|
}
|
||
|
|
||
|
private void SetData()
|
||
|
{
|
||
|
Item.GetComponent<LinkageForceItemController>().BMText.text = BMInput.text;
|
||
|
Item.GetComponent<LinkageForceItemController>().MCText.text = MCInput.text;
|
||
|
Item.GetComponent<LinkageForceItemController>().DZText.text = DZInput.text;
|
||
|
Item.GetComponent<LinkageForceItemController>().DHText.text = DHInput.text;
|
||
|
Item.GetComponent<LinkageForceItemController>().LLText.text = LLInput.text;
|
||
|
Item.GetComponent<LinkageForceItemController>().RWText.text = RWInput.text;
|
||
|
|
||
|
Hide();
|
||
|
}
|
||
|
|
||
|
}
|