SavedAttachData.cs 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. public class SavedAttachData
  5. {
  6. public void Reset()
  7. {
  8. this.bEnable = false;
  9. this.nMyRID = 0UL;
  10. this.eMySlotID = TBody.SlotID.body;
  11. this.nTargetRID = 0UL;
  12. this.eTargetSlotID = TBody.SlotID.body;
  13. this.nTargetSlotNo = 0;
  14. this.strTargetAttachPointName = null;
  15. this.nTargetVtxCount = 0;
  16. this.nTargetVidx = 0;
  17. this.newAttachVidx = null;
  18. this.prs2 = new PosRotScale();
  19. this.prs3 = new PosRotScale();
  20. if (this.boneAttachedHie != null)
  21. {
  22. this.boneAttachedHie.Clear();
  23. }
  24. this.boneAttachEdited = false;
  25. }
  26. public void Deserialize(BinaryReader br)
  27. {
  28. this.nTargetSlotNo = 0;
  29. int num = 2000;
  30. br.ReadNaS(out this.partName);
  31. if (string.IsNullOrEmpty(this.partName))
  32. {
  33. num = br.ReadInt32();
  34. br.ReadNaS(out this.partName);
  35. }
  36. br.Read(out this.bEnable);
  37. br.Read(out this.nMyRID);
  38. br.ReadParse(out this.eMySlotID);
  39. br.Read(out this.nTargetRID);
  40. br.ReadParse(out this.eTargetSlotID);
  41. if (2001 <= num)
  42. {
  43. this.nTargetSlotNo = br.ReadInt32();
  44. }
  45. br.ReadNaS(out this.strTargetAttachPointName);
  46. br.Read(out this.nTargetVtxCount);
  47. br.Read(out this.nTargetVidx);
  48. br.Read(out this.newAttachVidx);
  49. this.prs2 = new PosRotScale();
  50. if (br.ReadBoolean())
  51. {
  52. this.prs2.Deserialize(br);
  53. }
  54. this.prs3 = new PosRotScale();
  55. if (br.ReadBoolean())
  56. {
  57. this.prs3.Deserialize(br);
  58. }
  59. this.boneAttachedHie = null;
  60. if (br.ReadBoolean())
  61. {
  62. this.boneAttachedHie = new Dictionary<string, PosRotScale>();
  63. int num2 = br.ReadInt32();
  64. for (int i = 0; i < num2; i++)
  65. {
  66. PosRotScale posRotScale = new PosRotScale();
  67. string key = br.ReadString();
  68. posRotScale.Deserialize(br);
  69. this.boneAttachedHie.Add(key, posRotScale);
  70. }
  71. }
  72. br.Read(out this.boneAttachEdited);
  73. }
  74. public string partName;
  75. public bool bEnable;
  76. public ulong nMyRID;
  77. public TBody.SlotID eMySlotID;
  78. public ulong nTargetRID;
  79. public TBody.SlotID eTargetSlotID;
  80. public int nTargetSlotNo;
  81. public string strTargetAttachPointName;
  82. public int nTargetVtxCount;
  83. public int nTargetVidx;
  84. public int[] newAttachVidx;
  85. public PosRotScale prs2 = new PosRotScale();
  86. public PosRotScale prs3 = new PosRotScale();
  87. public Dictionary<string, PosRotScale> boneAttachedHie;
  88. public bool boneAttachEdited;
  89. }