using UniRx; using UnityEngine; public class BuildingAdjacent { /// ///ID /// public string Id{get;set;} /// ///图片地址 /// public string ImageUrl{get;set;} /// ///图片类型 /// public OriginalImageType ImageType{get;set;} /// ///道路 /// public string Street{get;set;} /// ///建筑 /// public string Building{get;set;} /// ///距离 /// public string Distance{get;set;} } public class BuildingAdjacentReactive:ISetData { /// ///Data /// private BuildingAdjacent Data{get;set;}= new BuildingAdjacent(); /// ///ID /// public ReactiveProperty Id{get;set;}= new ReactiveProperty(); /// ///图片地址 /// public ReactiveProperty ImageUrl{get;set;}= new ReactiveProperty(); /// ///图片类型 /// public ReactiveProperty ImageType{get;set;}= new ReactiveProperty(); /// ///道路 /// public ReactiveProperty Street{get;set;}= new ReactiveProperty(); /// ///建筑 /// public ReactiveProperty Building{get;set;}= new ReactiveProperty(); /// ///距离 /// public ReactiveProperty Distance{get;set;}= new ReactiveProperty(); public BuildingAdjacentReactive() { Id.Subscribe(value => Data.Id= value); ImageUrl.Subscribe(value => Data.ImageUrl= value); ImageType.Subscribe(value => Data.ImageType= value); Street.Subscribe(value => Data.Street= value); Building.Subscribe(value => Data.Building= value); Distance.Subscribe(value => Data.Distance= value); } public void SetData(BuildingAdjacent data) { Data = data; Id.Value = data.Id; ImageUrl.Value = data.ImageUrl; ImageType.Value = data.ImageType; Street.Value = data.Street; Building.Value = data.Building; Distance.Value = data.Distance; } public BuildingAdjacent GetData() { return Data; } }