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