/// <summary> /// Wait some time before start some method /// </summary> /// <param name="seconds"></param> /// <param name="method"></param> /// <returns></returns> IEnumerator Wait(float seconds, someMethod method) { yield return(new WaitForSeconds(seconds)); method(); }
// Constructor public Timer(someMethod method, int totalSeconds, int everyNSeconds) { this.method = method; this.totalSeconds = totalSeconds; this.everyNSeconds = everyNSeconds; }