RoleCustomBoneData.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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> orginLocalPositionList;
  12. public Dictionary<string, Quaternion> orginLocalRotationList;
  13. public Dictionary<string, float> orginBlendList;
  14. public Dictionary<int, float> changedValueList;
  15. public Dictionary<string, Vector3> changedScaleList;
  16. public Dictionary<string, Vector3> changedPositionList;
  17. public Dictionary<string, Vector3> changedRotationList;
  18. public RoleCustomData ()
  19. {
  20. bodyList = new Dictionary<int, PartData>();
  21. faceList = new Dictionary<int, PartData>();
  22. orginLocalScaleList = new Dictionary<string, Vector3>();
  23. orginLocalPositionList = new Dictionary<string, Vector3>();
  24. orginLocalRotationList = new Dictionary<string, Quaternion>();
  25. orginBlendList = new Dictionary<string, float>();
  26. changedValueList = new Dictionary<int, float>();
  27. changedScaleList = new Dictionary<string, Vector3>();
  28. changedPositionList = new Dictionary<string, Vector3>();
  29. changedRotationList = new Dictionary<string, Vector3>();
  30. }
  31. }
  32. public class PartData
  33. {
  34. public int id;
  35. public EditableBodyPart part;
  36. public ModifyType modifyType;
  37. public float floatValue;
  38. public Vector3 vecValue;
  39. public string pathValue;
  40. public string[] bones;
  41. //使用变形器
  42. public string biggerBlendName;
  43. public string smallerBlendName;
  44. public bool useBlend;
  45. public float minChangeValue;
  46. public float maxChangeValue;
  47. public Vector3 scaleChange;
  48. public Vector3 positionChange;
  49. public Vector3 rotationChange;
  50. public PartData(int _id,EditableBodyPart _part, ModifyType _modifyType)
  51. {
  52. id = _id;
  53. part = _part;
  54. modifyType = _modifyType;
  55. floatValue = 1;
  56. vecValue = Vector3.zero;
  57. pathValue = "";
  58. }
  59. 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)
  60. {
  61. id = _id;
  62. vecValue = Vector3.zero;
  63. pathValue = "";
  64. bones = _bones;
  65. scaleChange = _scaleChange;
  66. positionChange = _posChange;
  67. rotationChange = _rotChange;
  68. useBlend = _useBlend;
  69. biggerBlendName = _bigBlendName;
  70. smallerBlendName = _smallBlendName;
  71. if(_useBlend)
  72. {
  73. floatValue = 0.5f;
  74. minChangeValue = 0;
  75. maxChangeValue = 1;
  76. }
  77. else
  78. {
  79. floatValue = 1;
  80. minChangeValue = _min;
  81. maxChangeValue = _max;
  82. }
  83. }
  84. }
  85. }