MessageData.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. public class MessageData
  6. {
  7. public string msgType { get; set; }
  8. public List<ModelData> listModelData { get; set; }
  9. public ModelData CreateModel { get; set; }
  10. public string DesModelId { get; set; }
  11. public MessageData(string msgType, List<ModelData> listModelData,ModelData createmodel,string desModelId)
  12. {
  13. this.msgType = msgType;
  14. this.listModelData = listModelData;
  15. this.CreateModel = createmodel;
  16. this.DesModelId = desModelId;
  17. }
  18. }
  19. public class TransformData
  20. {
  21. public SerializableVector3 pos { get; set; }
  22. public SerializableVector3 eul { get; set; }
  23. public SerializableVector3 scale { get; set; }
  24. public TransformData(SerializableVector3 pos , SerializableVector3 eul, SerializableVector3 scale)
  25. {
  26. this.pos = pos;
  27. this.eul = eul;
  28. this.scale = scale;
  29. }
  30. }
  31. public class ModelData
  32. {
  33. public string id { get; set; }
  34. public string name { get; set; }
  35. public TransformData transformData { get; set; }
  36. public bool isShowBox { get; set; }
  37. public bool isSnatch { get; set; }
  38. public bool isPlayer { get; set; }
  39. public ModelData( string id , string name ,TransformData transfromData, bool isShowBox,bool isSnatch,bool isPlayer)
  40. {
  41. this.id = id;
  42. this.name = name;
  43. this.transformData = transfromData;
  44. this.isShowBox = isShowBox;
  45. this.isSnatch = isSnatch;
  46. this.isPlayer = isPlayer;
  47. }
  48. }
  49. [System.Serializable]
  50. public struct SerializableVector3
  51. {
  52. public float x;
  53. public float y;
  54. public float z;
  55. public SerializableVector3(float rX, float rY, float rZ)
  56. {
  57. x = rX;
  58. y = rY;
  59. z = rZ;
  60. }
  61. public override string ToString()
  62. {
  63. return String.Format("[{0}, {1}, {2}]", x, y, z);
  64. }
  65. public static implicit operator Vector3(SerializableVector3 rValue)
  66. {
  67. return new Vector3(rValue.x, rValue.y, rValue.z);
  68. }
  69. public static implicit operator SerializableVector3(Vector3 rValue)
  70. {
  71. return new SerializableVector3(rValue.x, rValue.y, rValue.z);
  72. }
  73. }
  74. //public class Hand
  75. //{
  76. // public TransformData transformData { get; set; }
  77. //}