Show / Hide Table of Contents

Class TimerProgress

An abstract base timer class that is intended to be used on any component/class that needs something to happen after X couple seconds. Supports duration, and the ability to loop.

Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
TimerProgress
SimpleTimer
Namespace: AdrianMiasik.Components.Base
Assembly: Assembly-CSharp.dll
Syntax
public abstract class TimerProgress : MonoBehaviour

Fields

| Improve this Doc View Source

m_duration

How long should this timer run for? (In seconds)

Declaration
[SerializeField]
protected float m_duration
Field Value
Type Description
System.Single
| Improve this Doc View Source

m_onComplete

Declaration
public UnityEvent m_onComplete
Field Value
Type Description
UnityEngine.Events.UnityEvent

Methods

| Improve this Doc View Source

Initialize(Single, Boolean)

Sets up and starts the timer using the provided preferences.

Declaration
public void Initialize(float timerDuration, bool loop = false)
Parameters
Type Name Description
System.Single timerDuration

How long should this timer run for?

System.Boolean loop

Should the timer repeat on completion?

| Improve this Doc View Source

IsRunning()

Returns the active running state of the timer. This turns to false on timer completion.

Declaration
public bool IsRunning()
Returns
Type Description
System.Boolean

Is timer updating/ticking/running right now?

| Improve this Doc View Source

OnComplete()

Invoked when the timer has completed.

Declaration
protected abstract void OnComplete()
| Improve this Doc View Source

OnStart()

Invoked on timer start / component initialization. Gets invoked on every timer loop too.

Declaration
protected abstract void OnStart()
| Improve this Doc View Source

OnUpdate(Single)

Update loop for timer.

Declaration
protected abstract void OnUpdate(float progress)
Parameters
Type Name Description
System.Single progress

A progress value between 0 to 1

| Improve this Doc View Source

Restart()

Restarts the timer and immediately starts the timer.

Declaration
protected void Restart()
| Improve this Doc View Source

Update()

Update/tick method for timer progression.

Declaration
protected virtual void Update()
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX