using UniRx; using UnityEngine; public class EscapeStair { /// ///ID /// public string Id{get;set;} /// ///编号 /// public string Number{get;set;} /// ///宽度 /// public string Width{get;set;} /// ///通往层数 /// public string Layer{get;set;} } public class EscapeStairReactive:ISetData { /// ///Data /// private EscapeStair Data{get;set;}= new EscapeStair(); /// ///ID /// public ReactiveProperty Id{get;set;}= new ReactiveProperty(); /// ///编号 /// public ReactiveProperty Number{get;set;}= new ReactiveProperty(); /// ///宽度 /// public ReactiveProperty Width{get;set;}= new ReactiveProperty(); /// ///通往层数 /// public ReactiveProperty Layer{get;set;}= new ReactiveProperty(); public EscapeStairReactive() { Id.Subscribe(value => Data.Id= value); Number.Subscribe(value => Data.Number= value); Width.Subscribe(value => Data.Width= value); Layer.Subscribe(value => Data.Layer= value); } public void SetData(EscapeStair data) { Data = data; Id.Value = data.Id; Number.Value = data.Number; Width.Value = data.Width; Layer.Value = data.Layer; } public EscapeStair GetData() { return Data; } }