PlayerAttributeDebugGUI.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using UnityEngine;
  3. namespace Tools
  4. {
  5. public class PlayerAttributeDebugGUI : DebugGuiBase
  6. {
  7. protected override string UIDebugButtonName
  8. {
  9. get
  10. {
  11. return "属性查看";
  12. }
  13. }
  14. protected override void GUIStart()
  15. {
  16. float num = (float)Screen.width;
  17. this.GUIArea = new Rect(num / 2f - 320f, 20f, 640f, 500f);
  18. }
  19. public override void OnDebugGUI()
  20. {
  21. GUILayout.BeginArea(this.GUIArea);
  22. GUILayout.BeginVertical("box", new GUILayoutOption[0]);
  23. GUILayout.Label(string.Concat(new object[]
  24. {
  25. "HP: ",
  26. R.Player.Attribute.currentHP,
  27. "/",
  28. R.Player.Attribute.maxHP
  29. }), new GUILayoutOption[0]);
  30. GUILayout.Label(string.Concat(new object[]
  31. {
  32. "Energy: ",
  33. R.Player.Attribute.currentEnergy,
  34. "/",
  35. R.Player.Attribute.maxEnergy
  36. }), new GUILayoutOption[0]);
  37. GUILayout.Label("Coin: " + R.Equipment.CoinNum, new GUILayoutOption[0]);
  38. GUILayout.EndVertical();
  39. GUILayout.EndArea();
  40. }
  41. private Rect GUIArea;
  42. }
  43. }