SkillAgentSearch skills...

UnityFlexTimer

An Efficient Unity Timer, easily customizeable and extensible

Install / Use

/learn @StinkySteak/UnityFlexTimer
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Simulation Timer

An Lightweight Efficient Timer for Unity. Inspired by Photon Fusion TickTimer

Usage/Examples

Simulation Timer

private FlexTimer _disableTimer;

private void Start()
{
    _disableTimer = FlexTimer.CreateFromSeconds(_delay);
}

private void Update()
{
    if (_disableTimer.IsExpired())
    {
        _gameObject.SetActive(false);
        _disableTimer = FlexTimer.None;
    }
}

Pauseable Simulation Timer

private PauseableFlexTimer _timer;

public PauseableFlexTimer Timer => _timer;

private void Start()
{
    _timer = PauseableFlexTimer.CreateFromSeconds(_delay);
}

public void TogglePause()
{
    if (!_timer.IsPaused)
    {
        _timer.Pause();
        return;
    }

    _timer.Resume();
}

private void Update()
{
    if (_timer.IsExpired())
    {
        _gameObject.SetActive(false);
        _timer = PauseableFlexTimer.None;
    }
}

Related Skills

View on GitHub
GitHub Stars6
CategoryDevelopment
Updated7mo ago
Forks0

Languages

C#

Security Score

82/100

Audited on Aug 25, 2025

No findings