using UnityEngine; using UnityEngine.UI; using UniRx; using AX.ImageViewer; public class EscapeStairAttributePanel : UIView { //编号 public Text NumberText; public InputField NumberInput; //宽度 public Text WidthText; public InputField WidthInput; //通往层数 public Text LayerText; public InputField LayerInput; //保存按钮 public Button SaveButton; public override void Awake() { base.Awake(); #region DataSource Bind //编号 DataSource.Number.SubscribeToText(NumberText).AddTo(gameObject); DataSource.Number.SubscribeToText(NumberInput).AddTo(gameObject); NumberInput.OnValueChangedAsObservable().Subscribe(s => DataSource.Number.Value = s); //宽度 DataSource.Width.SubscribeToText(WidthText).AddTo(gameObject); DataSource.Width.SubscribeToText(WidthInput).AddTo(gameObject); WidthInput.OnValueChangedAsObservable().Subscribe(s => DataSource.Width.Value = s); //通往层数 DataSource.Layer.SubscribeToText(LayerText).AddTo(gameObject); DataSource.Layer.SubscribeToText(LayerInput).AddTo(gameObject); LayerInput.OnValueChangedAsObservable().Subscribe(s => DataSource.Layer.Value = s); #endregion #region Button Click //保存 SaveButton.onClick.AsObservable().Subscribe(onClick => { SaveData(); }).AddTo(gameObject); transform.Find("TitleBar/CloseButton").GetComponent