using UniRx; using UnityEngine; public class BuildingFeature { /// ///详情 /// public string Details{get;set;} /// ///图片类型 /// public OriginalImageType ImageType{get;set;} /// ///图片地址 /// public string ImageUrl{get;set;} } public class BuildingFeatureReactive:ISetData { /// ///Data /// private BuildingFeature Data{get;set;}= new BuildingFeature(); /// ///详情 /// public ReactiveProperty Details{get;set;}= new ReactiveProperty(); /// ///图片类型 /// public ReactiveProperty ImageType{get;set;}= new ReactiveProperty(); /// ///图片地址 /// public ReactiveProperty ImageUrl{get;set;}= new ReactiveProperty(); public BuildingFeatureReactive() { Details.Subscribe(value => Data.Details= value); ImageType.Subscribe(value => Data.ImageType= value); ImageUrl.Subscribe(value => Data.ImageUrl= value); } public void SetData(BuildingFeature data) { Data = data; Details.Value = data.Details; ImageType.Value = data.ImageType; ImageUrl.Value = data.ImageUrl; } public BuildingFeature GetData() { return Data; } }