上海虹口龙之梦项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

87 lines
2.3 KiB

using UniRx;
using UnityEngine;
public class FireStation
{
/// <summary>
///位置
/// <summary>
public string Location{get;set;}
/// <summary>
///联系人
/// <summary>
public string Contact{get;set;}
/// <summary>
///电话
/// <summary>
public string Phone{get;set;}
/// <summary>
///装备
/// <summary>
public string Equips{get;set;}
/// <summary>
///图片地址
/// <summary>
public string ImageUrl{get;set;}
/// <summary>
///图片类型
/// <summary>
public OriginalImageType ImageType{get;set;}
}
public class FireStationReactive:ISetData<FireStation>
{
/// <summary>
///Data
/// <summary>
private FireStation Data{get;set;}= new FireStation();
/// <summary>
///位置
/// <summary>
public ReactiveProperty<string> Location{get;set;}= new ReactiveProperty<string>();
/// <summary>
///联系人
/// <summary>
public ReactiveProperty<string> Contact{get;set;}= new ReactiveProperty<string>();
/// <summary>
///电话
/// <summary>
public ReactiveProperty<string> Phone{get;set;}= new ReactiveProperty<string>();
/// <summary>
///装备
/// <summary>
public ReactiveProperty<string> Equips{get;set;}= new ReactiveProperty<string>();
/// <summary>
///图片地址
/// <summary>
public ReactiveProperty<string> ImageUrl{get;set;}= new ReactiveProperty<string>();
/// <summary>
///图片类型
/// <summary>
public ReactiveProperty<OriginalImageType> ImageType{get;set;}= new ReactiveProperty<OriginalImageType>();
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;
}
}