DebugBowPower.cs 924 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. int 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 = 20;
  24. valueText.text = value.ToString();
  25. progress.fillAmount = (float) value / 100.0f;
  26. }
  27. public void DoUpdate()
  28. {
  29. if (value >= 100) return;
  30. value++;
  31. valueText.text = value.ToString();
  32. progress.fillAmount = (float) value / 100.0f;
  33. }
  34. public float getPowerPercent()
  35. {
  36. return (float) value / 100.0f;
  37. }
  38. }