DoublePKGameView.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. public class DoublePKGameView : MonoBehaviour
  6. {
  7. [SerializeField] Text scoreText1P;
  8. [SerializeField] Text scoreText2P;
  9. [SerializeField] Text timeText;
  10. [SerializeField] Text Battery1P;
  11. [SerializeField] Text Battery2P;
  12. private string batteryLevel;
  13. // Start is called before the first frame update
  14. void Start()
  15. {
  16. batteryLevel = TextAutoLanguage2.GetTextByKey("BatteryLevel");
  17. setBattery1P(0);
  18. setBattery2P(0);
  19. }
  20. // Update is called once per frame
  21. //void Update()
  22. //{
  23. //}
  24. public void setScore1P(float value) {
  25. scoreText1P.text = value.ToString();
  26. }
  27. public void setScore2P(float value)
  28. {
  29. scoreText2P.text = value.ToString();
  30. }
  31. public void setTime(string value) {
  32. timeText.text = value;
  33. }
  34. public void setBattery1P(int value)
  35. {
  36. Battery1P.text = batteryLevel + ":" + value.ToString() + "%";
  37. }
  38. public void setBattery2P(int value)
  39. {
  40. Battery2P.text = batteryLevel + ":" + value.ToString() + "%";
  41. }
  42. }