using UniRx; using UnityEngine; public class EquipmentRoom { /// ///ID /// public string Id{get;set;} /// ///名称 /// public string Name{get;set;} /// ///位置 /// public string Location{get;set;} /// ///详情 /// public string Details{get;set;} /// ///图片地址 /// public string ImageUrl{get;set;} /// ///图片类型 /// public OriginalImageType ImageType{get;set;} } public class EquipmentRoomReactive:ISetData { /// ///Data /// private EquipmentRoom Data{get;set;}= new EquipmentRoom(); /// ///ID /// public ReactiveProperty Id{get;set;}= new ReactiveProperty(); /// ///名称 /// public ReactiveProperty Name{get;set;}= new ReactiveProperty(); /// ///位置 /// public ReactiveProperty Location{get;set;}= new ReactiveProperty(); /// ///详情 /// public ReactiveProperty Details{get;set;}= new ReactiveProperty(); /// ///图片地址 /// public ReactiveProperty ImageUrl{get;set;}= new ReactiveProperty(); /// ///图片类型 /// public ReactiveProperty ImageType{get;set;}= new ReactiveProperty(); public EquipmentRoomReactive() { Id.Subscribe(value => Data.Id= value); Name.Subscribe(value => Data.Name= value); Location.Subscribe(value => Data.Location= value); Details.Subscribe(value => Data.Details= value); ImageUrl.Subscribe(value => Data.ImageUrl= value); ImageType.Subscribe(value => Data.ImageType= value); } public void SetData(EquipmentRoom data) { Data = data; Id.Value = data.Id; Name.Value = data.Name; Location.Value = data.Location; Details.Value = data.Details; ImageUrl.Value = data.ImageUrl; ImageType.Value = data.ImageType; } public EquipmentRoom GetData() { return Data; } }