BodyStatusCtrl.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using UnityEngine;
  3. public class BodyStatusCtrl : MonoBehaviour
  4. {
  5. public void Init(BodyStatusMgr mgr, GameObject m_goPanel)
  6. {
  7. GameObject childObject = UTY.GetChildObject(m_goPanel, "BodySize", false);
  8. this.m_lHeight = UTY.GetChildObject(childObject, "Height/Value", false).GetComponent<UILabel>();
  9. this.m_lWeight = UTY.GetChildObject(childObject, "Weight/Value", false).GetComponent<UILabel>();
  10. this.m_lBust = UTY.GetChildObject(childObject, "Bust/Value", false).GetComponent<UILabel>();
  11. this.m_lCup = UTY.GetChildObject(childObject, "Bust/Cup/Value", false).GetComponent<UILabel>();
  12. this.m_lWaist = UTY.GetChildObject(childObject, "Waist/Value", false).GetComponent<UILabel>();
  13. this.m_lHip = UTY.GetChildObject(childObject, "Hip/Value", false).GetComponent<UILabel>();
  14. UIButton component = UTY.GetChildObject(m_goPanel, "Close", false).GetComponent<UIButton>();
  15. EventDelegate.Add(component.onClick, new EventDelegate.Callback(mgr.CloseBodyPanel));
  16. }
  17. public void SetData(BodyStatusCtrl.Status status)
  18. {
  19. this.m_lHeight.text = status.height.ToString();
  20. this.m_lWeight.text = status.weight.ToString();
  21. this.m_lBust.text = status.bust.ToString();
  22. this.m_lCup.text = status.cup;
  23. this.m_lWaist.text = status.waist.ToString();
  24. this.m_lHip.text = status.hip.ToString();
  25. }
  26. private UILabel m_lHeight;
  27. private UILabel m_lWeight;
  28. private UILabel m_lBust;
  29. private UILabel m_lCup;
  30. private UILabel m_lWaist;
  31. private UILabel m_lHip;
  32. public class Status
  33. {
  34. public int height;
  35. public int weight;
  36. public int bust;
  37. public string cup;
  38. public int waist;
  39. public int hip;
  40. }
  41. }