上海虹口龙之梦项目
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.
 
 
 
 

161 lines
4.6 KiB

using UnityEngine;
using UniRx;
/// <summary>
// 该文件根据 CloneObject.xlsx 由程序自动生成
/// </summary>
public class CloneObject
{
/// <summary>
/// ID
/// </summary>
public string Id { get; set; }
/// <summary>
/// 位置
/// </summary>
public Vector3 Position { get; set; }
/// <summary>
/// 旋转
/// </summary>
public Vector3 Rotation { get; set; }
/// <summary>
/// 父对象
/// </summary>
public string Parent { get; set; }
/// <summary>
/// 图片地址
/// </summary>
public string ImageUrl { get; set; }
/// <summary>
/// 图片类型
/// </summary>
public OriginalImageType ImageType { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 位置
/// </summary>
public string Address { get; set; }
/// <summary>
/// 详情
/// </summary>
public string Discription { get; set; }
/// <summary>
/// 实例化物体类型
/// </summary>
public EquipmentType ObjectType { get; set; }
/// <summary>
/// 纹理节点数据
/// </summary>
public Vector3[] MeshVertices { get; set; }
/// <summary>
/// 距离1
/// </summary>
public float Distance1 { get; set; }
/// <summary>
/// 距离2
/// </summary>
public float Distance2 { get; set; }
}
public class CloneObjectReactive : ISetData<CloneObject>
{
protected virtual CloneObject Data { get; set; } = new CloneObject();
/// <summary>
/// ID
/// </summary>
public ReactiveProperty<string> Id { get; private set; } = new ReactiveProperty<string>();
/// <summary>
/// 位置
/// </summary>
public ReactiveProperty<Vector3> Position { get; private set; } = new ReactiveProperty<Vector3>();
/// <summary>
/// 旋转
/// </summary>
public ReactiveProperty<Vector3> Rotation { get; private set; } = new ReactiveProperty<Vector3>();
/// <summary>
/// 父对象
/// </summary>
public ReactiveProperty<string> Parent { get; private set; } = new ReactiveProperty<string>();
/// <summary>
/// 图片地址
/// </summary>
public ReactiveProperty<string> ImageUrl { get; private set; } = new ReactiveProperty<string>();
/// <summary>
/// 图片类型
/// </summary>
public ReactiveProperty<OriginalImageType> ImageType { get; private set; } = new ReactiveProperty<OriginalImageType>();
/// <summary>
/// 名称
/// </summary>
public ReactiveProperty<string> Name { get; private set; } = new ReactiveProperty<string>();
/// <summary>
/// 位置
/// </summary>
public ReactiveProperty<string> Address { get; private set; } = new ReactiveProperty<string>();
/// <summary>
/// 详情
/// </summary>
public ReactiveProperty<string> Discription { get; private set; } = new ReactiveProperty<string>();
/// <summary>
/// 实例化物体类型
/// </summary>
public ReactiveProperty<EquipmentType> ObjectType { get; private set; } = new ReactiveProperty<EquipmentType>();
/// <summary>
/// 纹理节点数据
/// </summary>
public ReactiveProperty<Vector3[]> MeshVertices { get; private set; } = new ReactiveProperty<Vector3[]>();
/// <summary>
/// 距离1
/// </summary>
public ReactiveProperty<float> Distance1 { get; private set; } = new ReactiveProperty<float>();
/// <summary>
/// 距离2
/// </summary>
public ReactiveProperty<float> Distance2 { get; private set; } = new ReactiveProperty<float>();
public CloneObjectReactive()
{
Id.Subscribe(value => Data.Id = value);
Position.Subscribe(value => Data.Position = value);
Rotation.Subscribe(value => Data.Rotation = value);
Parent.Subscribe(value => Data.Parent = value);
ImageUrl.Subscribe(value => Data.ImageUrl = value);
ImageType.Subscribe(value => Data.ImageType = value);
Name.Subscribe(value => Data.Name = value);
Address.Subscribe(value => Data.Address = value);
Discription.Subscribe(value => Data.Discription = value);
//Color.Subscribe(value => Data.Color = value);
//Mesh.Subscribe(value => Data.Mesh = value);
ObjectType.Subscribe(value => Data.ObjectType = value);
MeshVertices.Subscribe(value => Data.MeshVertices = value);
Distance1.Subscribe(value => Data.Distance1 = value);
Distance2.Subscribe(value => Data.Distance2 = value);
}
public void SetData(CloneObject data)
{
Data = data;
Id.Value = data.Id;
Position.Value = data.Position;
Rotation.Value = data.Rotation;
Parent.Value = data.Parent;
ImageUrl.Value = data.ImageUrl;
ImageType.Value = data.ImageType;
Name.Value = data.Name;
Address.Value = data.Address;
Discription.Value = data.Discription;
//Color.Value = data.Color;
//Mesh.Value = data.Mesh;
ObjectType.Value = data.ObjectType;
MeshVertices.Value = data.MeshVertices;
Distance1.Value = data.Distance1;
Distance2.Value = data.Distance2;
}
public CloneObject GetData()
{
return Data;
}
}