using UniRx; using UnityEngine; public class FireEscape { /// ///ID /// public string Id{get;set;} /// ///位置 /// public string Location{get;set;} /// ///宽度 /// public string Width{get;set;} /// ///图片地址 /// public string ImageUrl{get;set;} /// ///图片类型 /// public OriginalImageType ImageType{get;set;} } public class FireEscapeReactive:ISetData { /// ///Data /// private FireEscape Data{get;set;}= new FireEscape(); /// ///ID /// public ReactiveProperty Id{get;set;}= new ReactiveProperty(); /// ///位置 /// public ReactiveProperty Location{get;set;}= new ReactiveProperty(); /// ///宽度 /// public ReactiveProperty Width{get;set;}= new ReactiveProperty(); /// ///图片地址 /// public ReactiveProperty ImageUrl{get;set;}= new ReactiveProperty(); /// ///图片类型 /// public ReactiveProperty ImageType{get;set;}= new ReactiveProperty(); public FireEscapeReactive() { Id.Subscribe(value => Data.Id= value); Location.Subscribe(value => Data.Location= value); Width.Subscribe(value => Data.Width= value); ImageUrl.Subscribe(value => Data.ImageUrl= value); ImageType.Subscribe(value => Data.ImageType= value); } public void SetData(FireEscape data) { Data = data; Id.Value = data.Id; Location.Value = data.Location; Width.Value = data.Width; ImageUrl.Value = data.ImageUrl; ImageType.Value = data.ImageType; } public FireEscape GetData() { return Data; } }