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.
58 lines
1.4 KiB
58 lines
1.4 KiB
1 year ago
|
using UniRx;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class WaterDiagram
|
||
|
{
|
||
|
/// <summary>
|
||
|
///详情
|
||
|
/// <summary>
|
||
|
public string Details{get;set;}
|
||
|
/// <summary>
|
||
|
///图片类型
|
||
|
/// <summary>
|
||
|
public OriginalImageType ImageType {get;set;}
|
||
|
/// <summary>
|
||
|
///图片地址
|
||
|
/// <summary>
|
||
|
public string ImageUrl{get;set;}
|
||
|
}
|
||
|
public class WaterDiagramReactive:ISetData<WaterDiagram>
|
||
|
{
|
||
|
/// <summary>
|
||
|
///Data
|
||
|
/// <summary>
|
||
|
private WaterDiagram Data{get;set;}= new WaterDiagram();
|
||
|
/// <summary>
|
||
|
///详情
|
||
|
/// <summary>
|
||
|
public ReactiveProperty<string> Details{get;set;}= new ReactiveProperty<string>();
|
||
|
/// <summary>
|
||
|
///图片类型
|
||
|
/// <summary>
|
||
|
public ReactiveProperty<OriginalImageType> ImageType{get;set;}= new ReactiveProperty<OriginalImageType>();
|
||
|
/// <summary>
|
||
|
///图片地址
|
||
|
/// <summary>
|
||
|
public ReactiveProperty<string> ImageUrl{get;set;}= new ReactiveProperty<string>();
|
||
|
|
||
|
public WaterDiagramReactive()
|
||
|
{
|
||
|
Details.Subscribe(value => Data.Details= value);
|
||
|
ImageType.Subscribe(value => Data.ImageType= value);
|
||
|
ImageUrl.Subscribe(value => Data.ImageUrl= value);
|
||
|
}
|
||
|
|
||
|
public void SetData(WaterDiagram data)
|
||
|
{
|
||
|
Data = data;
|
||
|
Details.Value = data.Details;
|
||
|
ImageType.Value = data.ImageType;
|
||
|
ImageUrl.Value = data.ImageUrl;
|
||
|
}
|
||
|
|
||
|
public WaterDiagram GetData()
|
||
|
{
|
||
|
return Data;
|
||
|
}
|
||
|
}
|