using UniRx; using UnityEngine; public class OutdoorHydrant : CloneObject { /// ///位置 /// public string Location{get;set;} /// ///编号 /// public string Number{get;set;} /// ///管径 /// public string Diameter{get;set;} /// ///牙口 /// public string Mouth{get;set;} /// ///状态 /// public string State{get;set;} } public class OutdoorHydrantReactive: CloneObjectReactive,ISetData { /// ///位置 /// public ReactiveProperty Location{get;set;} /// ///编号 /// public ReactiveProperty Number{get;set;} /// ///管径 /// public ReactiveProperty Diameter{get;set;} /// ///牙口 /// public ReactiveProperty Mouth{get;set;} /// ///状态 /// public ReactiveProperty State{get;set;} public OutdoorHydrantReactive() { Data = new OutdoorHydrant(); Location = new ReactiveProperty(); Location.Subscribe(value => ((OutdoorHydrant)Data).Location= value); Number = new ReactiveProperty(); Number.Subscribe(value => ((OutdoorHydrant)Data).Number= value); Diameter = new ReactiveProperty(); Diameter.Subscribe(value => ((OutdoorHydrant)Data).Diameter= value); Mouth = new ReactiveProperty(); Mouth.Subscribe(value => ((OutdoorHydrant)Data).Mouth= value); State = new ReactiveProperty(); State.Subscribe(value => ((OutdoorHydrant)Data).State= value); } public void SetData(OutdoorHydrant data) { base.SetData(data); Id.Value = data.Id; Parent.Value = data.Parent; ImageUrl.Value = data.ImageUrl; ImageType.Value = data.ImageType; Location.Value = data.Location; Number.Value = data.Number; Diameter.Value = data.Diameter; Mouth.Value = data.Mouth; State.Value = data.State; } }