RoleCustomBoneData.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace MetaClient
  5. {
  6. public class RoleCustomData
  7. {
  8. public Dictionary<int, PartData> bodyList;
  9. public Dictionary<int, PartData> faceList;
  10. public Dictionary<string, Vector3> orginLocalScaleList;
  11. public Dictionary<string, Vector3> orginChangeScaleList;
  12. public Dictionary<string, Vector3> ChangedScaleParamsList;
  13. public Dictionary<string, Vector3> orginLocalPositionList;
  14. public Dictionary<string, Vector3> orginLocalRotationList;
  15. public Dictionary<string, float> orginBlendList;
  16. public Dictionary<int, float> changedValueList;
  17. public Dictionary<string, Vector3> changedScaleList;
  18. public Dictionary<string, Vector3> changedPositionList;
  19. public Dictionary<string, Vector3> changedRotationList;
  20. public RoleCustomData ()
  21. {
  22. bodyList = new Dictionary<int, PartData>();
  23. faceList = new Dictionary<int, PartData>();
  24. orginLocalScaleList = new Dictionary<string, Vector3>();
  25. orginChangeScaleList = new Dictionary<string, Vector3>();
  26. ChangedScaleParamsList = new Dictionary<string, Vector3>();
  27. orginLocalPositionList = new Dictionary<string, Vector3>();
  28. orginLocalRotationList = new Dictionary<string, Vector3>();
  29. orginBlendList = new Dictionary<string, float>();
  30. changedValueList = new Dictionary<int, float>();
  31. changedScaleList = new Dictionary<string, Vector3>();
  32. changedPositionList = new Dictionary<string, Vector3>();
  33. changedRotationList = new Dictionary<string, Vector3>();
  34. }
  35. }
  36. public class PartData
  37. {
  38. public int id;
  39. public EditableBodyPart part;
  40. public ModifyType modifyType;
  41. public float floatValue;
  42. public Vector3 vecValue;
  43. public string pathValue;
  44. public string[] bones;
  45. //使用变形器
  46. public string biggerBlendName;
  47. public string smallerBlendName;
  48. public bool useBlend;
  49. public bool oneBlend;
  50. public float minChangeValue;
  51. public float maxChangeValue;
  52. public Vector3 scaleChange;
  53. public Vector3 positionChange;
  54. public Vector3 rotationChange;
  55. public PartData(int _id,EditableBodyPart _part, ModifyType _modifyType)
  56. {
  57. id = _id;
  58. part = _part;
  59. modifyType = _modifyType;
  60. floatValue = 1;
  61. vecValue = Vector3.zero;
  62. pathValue = "";
  63. }
  64. public PartData(int _id,string[] _bones,float _min,float _max,Vector3 _scaleChange,Vector3 _posChange,Vector3 _rotChange,bool _useBlend,string _bigBlendName,string _smallBlendName,float _defaultValue = 0)
  65. {
  66. id = _id;
  67. vecValue = Vector3.zero;
  68. pathValue = "";
  69. bones = _bones;
  70. scaleChange = _scaleChange;
  71. positionChange = _posChange;
  72. rotationChange = _rotChange;
  73. useBlend = _useBlend;
  74. biggerBlendName = _bigBlendName;
  75. smallerBlendName = _smallBlendName;
  76. if(biggerBlendName == "" || biggerBlendName == "no" || smallerBlendName == "" || smallerBlendName == "no")
  77. {
  78. oneBlend = true;
  79. }else
  80. {
  81. oneBlend = false;
  82. }
  83. if(_useBlend)
  84. {
  85. if(oneBlend)
  86. {
  87. floatValue = 0;
  88. }else
  89. {
  90. floatValue = 0.5f;
  91. }
  92. minChangeValue = 0;
  93. maxChangeValue = 1;
  94. }
  95. else
  96. {
  97. floatValue = 1;
  98. minChangeValue = _min;
  99. maxChangeValue = _max;
  100. }
  101. }
  102. }
  103. }