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