Wilson403 / UnityTimer

Easy-to-use timer and small code designed for Untiy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Overview

Easy-to-use timer and small code designed for Untiy


How to run the demo

  • doule click on the Start.scene

How to use it

  • You can create timers for any time unit

    public static CountTickClock CreateFrameClock (Action<long> onUpdate , bool autoStart = true)
    {
        return new CountTickClock (FRAME_TICK_COUNT , onUpdate , autoStart);
    }
    
    public static CountTickClock CreateSecondClock (Action<long> onUpdate , bool autoStart = true)
    {
        return new CountTickClock (SECOND_TICK_COUNT , onUpdate , autoStart);
    }
  • Wait for the specified time and then execute

    UnityTimerMgr.CreateSecondClock ().Wait (10).Then (() => 
    {
        Debug.Log ("After 10 seconds");
    });
  • Refer to StartDemo.cs for more details


About Promise

Primise4CSharp

About

Easy-to-use timer and small code designed for Untiy

License:MIT License


Languages

Language:C# 100.0%