Iuvo Unity 0.5.1
This is library containing a variety of helper classes and extension methods for the Unity gane engine.
GitHub | Iuvo Unity Updates | Creator
Loading...
Searching...
No Matches
TimerTestUI Class Reference
Inheritance diagram for TimerTestUI:

Public Member Functions

void Awake ()
void Start ()
void Update ()

Public Attributes

TimerConfiguration timerConfig
TextMeshProUGUI timerText
Timer testTimer

Member Function Documentation

◆ Awake()

void TimerTestUI.Awake ( )
19 {
20 if (timerConfig == null)
21 {
22 IuvoDebug.DebugLogError("TimerTestUI: No TimerConfiguration assigned in inspector.");
23 return;
24 }
25 if (timerText == null)
26 {
27 IuvoDebug.DebugLogError("TimerTestUI: No TextMeshPro assigned in inspector.");
28 return;
29 }
30
31 testTimer = gameObject.GetOrAdd<Timer>();
32 timerConfig.Configure(testTimer);
33 }
TextMeshProUGUI timerText
Definition TimerTestUI.cs:14
TimerConfiguration timerConfig
Definition TimerTestUI.cs:13
Timer testTimer
Definition TimerTestUI.cs:15

References IuvoUnity.Debug.IuvoDebug.DebugLogError(), testTimer, timerConfig, and timerText.

◆ Start()

void TimerTestUI.Start ( )
36 {
37 timerText.SetText(TimeKeeper.FormatElapsedTime(testTimer));
38 IuvoDebug.DebugLog("TimerTestUI: Timer started with mode " + testTimer.activityMode.ToString());
39 testTimer.StartTimer();
40 }

References IuvoUnity.Debug.IuvoDebug.DebugLog(), IuvoUnity.IuvoTime.TimeKeeper.FormatElapsedTime(), testTimer, and timerText.

◆ Update()

void TimerTestUI.Update ( )
43 {
44 if (testTimer == null || timerText == null) return;
45
46 if (TimeKeeper.IsDecrement(testTimer.activityMode))
47 {
48 timerText.SetText(TimeKeeper.FormatRemainingTime(testTimer));
49 }
50 else if (TimeKeeper.IsIncrement(testTimer.activityMode) || TimeKeeper.IsStopwatch(testTimer.activityMode))
51 {
52 timerText.SetText(TimeKeeper.FormatElapsedTime(testTimer));
53 }
54
55
56 }

References IuvoUnity.IuvoTime.TimeKeeper.FormatElapsedTime(), IuvoUnity.IuvoTime.TimeKeeper.FormatRemainingTime(), IuvoUnity.IuvoTime.TimeKeeper.IsDecrement(), IuvoUnity.IuvoTime.TimeKeeper.IsIncrement(), IuvoUnity.IuvoTime.TimeKeeper.IsStopwatch(), testTimer, and timerText.

Member Data Documentation

◆ testTimer

Timer TimerTestUI.testTimer

Referenced by Awake(), Start(), and Update().

◆ timerConfig

TimerConfiguration TimerTestUI.timerConfig

Referenced by Awake().

◆ timerText

TextMeshProUGUI TimerTestUI.timerText

Referenced by Awake(), Start(), and Update().


The documentation for this class was generated from the following file: