using UniRx; using UnityEngine; public class FireStation { /// ///位置 /// public string Location{get;set;} /// ///联系人 /// public string Contact{get;set;} /// ///电话 /// public string Phone{get;set;} /// ///装备 /// public string Equips{get;set;} /// ///图片地址 /// public string ImageUrl{get;set;} /// ///图片类型 /// public OriginalImageType ImageType{get;set;} } public class FireStationReactive:ISetData { /// ///Data /// private FireStation Data{get;set;}= new FireStation(); /// ///位置 /// public ReactiveProperty Location{get;set;}= new ReactiveProperty(); /// ///联系人 /// public ReactiveProperty Contact{get;set;}= new ReactiveProperty(); /// ///电话 /// public ReactiveProperty Phone{get;set;}= new ReactiveProperty(); /// ///装备 /// public ReactiveProperty Equips{get;set;}= new ReactiveProperty(); /// ///图片地址 /// public ReactiveProperty ImageUrl{get;set;}= new ReactiveProperty(); /// ///图片类型 /// public ReactiveProperty ImageType{get;set;}= new ReactiveProperty(); public FireStationReactive() { Location.Subscribe(value => Data.Location= value); Contact.Subscribe(value => Data.Contact= value); Phone.Subscribe(value => Data.Phone= value); Equips.Subscribe(value => Data.Equips= value); ImageUrl.Subscribe(value => Data.ImageUrl= value); ImageType.Subscribe(value => Data.ImageType= value); } public void SetData(FireStation data) { Data = data; Location.Value = data.Location; Contact.Value = data.Contact; Phone.Value = data.Phone; Equips.Value = data.Equips; ImageUrl.Value = data.ImageUrl; ImageType.Value = data.ImageType; } public FireStation GetData() { return Data; } }