Exemplo n.º 1
0
    private IEnumerator Begin(Timer.NullDelegate method, float time)
    {
        yield return(new WaitForSeconds(time));

        method();
        Destroy(gameObject);
    }
Exemplo n.º 2
0
    public void New(Timer.NullDelegate method, float seconds, bool start)
    {
        this.seconds = seconds;
        this.method  = method;

        if (start)
        {
            //method();
            StartCoroutine(Begin(method, seconds));
        }
    }