RoleCustomBoneData.cs 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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 blendName;
  43. public bool useBlend;
  44. public float minChangeValue;
  45. public float maxChangeValue;
  46. public Vector3 scaleChange;
  47. public Vector3 positionChange;
  48. public Vector3 rotationChange;
  49. public PartData(int _id,EditableBodyPart _part, ModifyType _modifyType)
  50. {
  51. id = _id;
  52. part = _part;
  53. modifyType = _modifyType;
  54. floatValue = 1;
  55. vecValue = Vector3.zero;
  56. pathValue = "";
  57. }
  58. public PartData(int _id,string[] _bones,float _min,float _max,Vector3 _scaleChange,Vector3 _posChange,Vector3 _rotChange,bool _useBlend,string _blendName,float _defaultValue = 0)
  59. {
  60. id = _id;
  61. vecValue = Vector3.zero;
  62. pathValue = "";
  63. bones = _bones;
  64. scaleChange = _scaleChange;
  65. positionChange = _posChange;
  66. rotationChange = _rotChange;
  67. useBlend = _useBlend;
  68. blendName = _blendName;
  69. if(_useBlend)
  70. {
  71. floatValue = _defaultValue;
  72. minChangeValue = 0;
  73. maxChangeValue = 1;
  74. }
  75. else
  76. {
  77. floatValue = 1;
  78. minChangeValue = _min;
  79. maxChangeValue = _max;
  80. }
  81. }
  82. }
  83. }