DebugBowPower.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class DebugBowPower : MonoBehaviour
  6. {
  7. [SerializeField] Image progress;
  8. [SerializeField] Text valueText;
  9. float value = 0;
  10. public static DebugBowPower ins;
  11. void Start()
  12. {
  13. ins = this;
  14. }
  15. public void Init()
  16. {
  17. value = 0;
  18. valueText.text = value.ToString();
  19. progress.fillAmount = (float) value / 100.0f;
  20. }
  21. public void PullFinish()
  22. {
  23. value = 5;
  24. valueText.text = value.ToString();
  25. progress.fillAmount = (float) value / 100.0f;
  26. }
  27. public void DoUpdate()
  28. {
  29. if (GameMgr.ins.gameOver)
  30. {
  31. return;
  32. }
  33. if (value >= 100) {
  34. value = 100;
  35. return;
  36. }
  37. value += 0.5f;
  38. valueText.text = value.ToString("#0");
  39. progress.fillAmount = (float) value / 100.0f;
  40. }
  41. public float getPowerPercent()
  42. {
  43. return (float) value / 100.0f;
  44. }
  45. }