Ejemplo n.º 1
0
 public void AddEvent(float time, GameEvent.Func f)
 {
     if (time > 0f)
     {
         StartCoroutine(DelayInvoke(time, f));
     }
     else
     {
         f();
     }
 }
Ejemplo n.º 2
0
    IEnumerator DelayInvoke(float time, GameEvent.Func f)
    {
        yield return(new WaitForSeconds(time));

        try
        {
            f();
        }
        catch (KeyNotFoundException e)
        {
            Debug.LogError("buff(" + id + ") " + e.Message);
            Debug.LogError(e.StackTrace);
            MessageBox.Show("buff param error", "buff(" + id + ") " + e.Message);
        }
    }
Ejemplo n.º 3
0
 public void AddEvent(float time, GameEvent.Func f, int count)
 {
     StartCoroutine(DelayInvokeRepeating(time, f, count));
 }