-
-
Notifications
You must be signed in to change notification settings - Fork 2
Timer
eisclimber edited this page Feb 11, 2024
·
2 revisions
class in ExPresSXR.Misc.Timing / Extends MonoBehavior
Component added via Component Menu
A simple component that acts as a timer that will signal upon timeout.
-
float _waitTime = DEFAULT_WAIT_TIME
: How long the timer takes to timeout. Must be greater than 0.0f. -
float remainingTime
: (Readonly) Returns the remaining time of the timer. If the timer is was not started or timed out, the value will be the value of TIMER_INACTIVE_WAIT_TIME. -
bool timerPaused
: If the timer is paused or not. -
bool running
: If the timer is actively is counting down, meaning it was started and is not paused. -
bool autoStart
: If true, will start the timer during OnAwake()... -
bool oneShot
: If false, the timer will restart after timeout.
-
void StartTimer(float duration = -1.0f)
: (Re-)starts the timer with duration, setting waitTime in the process. If duration is <= 0.0f the value of waitTime is used. -
void PauseTimer(bool paused)
: Starts the timer usingwaitTime
. /// Prevents the need to provide a value if invoked via UnityEvents. -
void ResumeTimer()
: Continues a paused timer or sStarts the timer usingwaitTime
. -
void SetTimerPaused(bool paused)
: Pauses or unpauses the timer, maintaining it's current waitTime (and not starting it, if not running) -
void PauseTimer()
: Pauses the timer if possible. -
void UnpauseTimer()
: Unpauses the timer if possible. -
void StopTimer()
: Stops and resets the timer whilst not emitting the timeout event.
-
UnityEvent OnStarted
: Event that is triggered when the timer was started. A started timer automatically be unpaused. -
UnityEvent OnTimeout
: Event that is triggered when the timer times out. -
UnityEvent<bool> OnPaused
: Event that is triggered when the timer is paused. The parameter is it is paused or not.
-
float TIMER_INACTIVE_WAIT_TIME = -1.0f
: Value ofremainingTime
when the timer is not active. -
float DEFAULT_WAIT_TIME = 1.0f
: Default wait time.
Autor: Luca 'eisclimber' Dreiling; License: MIT
- Getting Started
- Development and Contribution
- Misc
- Experimentation
- Data Gatherering
- Eye Tracking
- ExPresS XR Rig
- Interaction
- Base Button
- Button Quiz
- Collision Hand Rumbler
- Collision Sound Emitter
- Exit Game Interactable (Script Deprecated)
- Interactables
- Haptic Impulse Trigger
- Socket Interactors
- Inverse Kinematics
- Localization
- Minigames
- Coin Scale
- Coin Throw
- Sword Cleaning
- Misc
- Movement
- Presentation
- UI