AttributeViewerOld.cs 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. using System;
  2. using System.Collections.Generic;
  3. using MaidStatus;
  4. using UnityEngine;
  5. public class AttributeViewerOld : MonoBehaviour
  6. {
  7. public void Awake()
  8. {
  9. if (this.seikantai_list_.Count != 0)
  10. {
  11. return;
  12. }
  13. GameObject childObject = UTY.GetChildObject(base.gameObject, "Contents/ErogenousZone/ErogenousZoneParent", false);
  14. string[] array = new string[]
  15. {
  16. "口",
  17. "喉",
  18. "乳首",
  19. "クリトリス"
  20. };
  21. for (int i = 0; i < array.Length; i++)
  22. {
  23. AttributeViewerOld.SeikantaiObject item = default(AttributeViewerOld.SeikantaiObject);
  24. GameObject gameObject = childObject.transform.GetChild(i).gameObject;
  25. item.gage = UTY.GetChildObject(gameObject, "Gauge", false).transform;
  26. item.percent_label = UTY.GetChildObject(gameObject, "Number/Value", false).GetComponent<UILabel>();
  27. this.seikantai_list_.Add(item);
  28. }
  29. this.seiheki_table_ = UTY.GetChildObject(base.gameObject, "Contents/Attribute/AttributeUnitParent", false).GetComponent<UITable>();
  30. List<Transform> childList = this.seiheki_table_.GetChildList();
  31. for (int j = 0; j < childList.Count; j++)
  32. {
  33. childList[j].gameObject.SetActive(false);
  34. }
  35. this.seiheki_table_.Reposition();
  36. }
  37. public void OnEnable()
  38. {
  39. this.Awake();
  40. this.UpdateStatusInfo();
  41. }
  42. public void SetMaid(Maid maid)
  43. {
  44. this.maid_ = maid;
  45. this.UpdateStatusInfo();
  46. }
  47. public void UpdateStatusInfo()
  48. {
  49. this.Awake();
  50. if (this.maid_ == null)
  51. {
  52. return;
  53. }
  54. Status status = this.maid_.status;
  55. int[] array = new int[]
  56. {
  57. status.OldStatus.sexual.mouth,
  58. status.OldStatus.sexual.throat,
  59. status.OldStatus.sexual.nipple,
  60. status.OldStatus.sexual.curi
  61. };
  62. NDebug.Assert(array.Length == this.seikantai_list_.Count, "error");
  63. for (int i = 0; i < this.seikantai_list_.Count; i++)
  64. {
  65. AttributeViewerOld.SeikantaiObject seikantaiObject = this.seikantai_list_[i];
  66. seikantaiObject.gage.transform.localScale = new Vector2((float)array[i] / 1000f, 1f);
  67. seikantaiObject.percent_label.text = (array[i] / 10).ToString();
  68. }
  69. List<Transform> childList = this.seiheki_table_.GetChildList();
  70. for (int j = 0; j < childList.Count; j++)
  71. {
  72. childList[j].gameObject.SetActive(false);
  73. }
  74. int num = 0;
  75. foreach (Propensity.Data data in status.propensitys.GetValueArray())
  76. {
  77. if (childList.Count <= num)
  78. {
  79. break;
  80. }
  81. childList[num].gameObject.SetActive(true);
  82. UILabel componentInChildren = childList[num].gameObject.GetComponentInChildren<UILabel>();
  83. if (!(componentInChildren == null))
  84. {
  85. componentInChildren.text = data.drawName;
  86. num++;
  87. }
  88. }
  89. }
  90. private Maid maid_;
  91. private List<AttributeViewerOld.SeikantaiObject> seikantai_list_ = new List<AttributeViewerOld.SeikantaiObject>();
  92. private UITable seiheki_table_;
  93. private struct SeikantaiObject
  94. {
  95. public Transform gage;
  96. public UILabel percent_label;
  97. }
  98. }