AnswerTimeSlider.cs 713 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using UnityEngine;
  5. using UnityEngine.UI;
  6. public class AnswerTimeSlider : MonoBehaviour
  7. {
  8. public string permanentText;
  9. public float startValue;
  10. private Text text;
  11. private string textAfterValue;
  12. // Start is called before the first frame update
  13. void Start()
  14. {
  15. text = GetComponent<Text>();
  16. textAfterValue = LocalizationManager.Instance.GetText(permanentText);
  17. textUpdate(startValue);
  18. }
  19. // Update is called once per frame
  20. void Update()
  21. {
  22. }
  23. public void textUpdate(float value) {
  24. text.text = Math.Round(value) + " " + textAfterValue;
  25. }
  26. }