public static void Create(Action action, float timer, string tag = null) { var components = new[] { typeof(MonoBehaviorHook) }; var gameObject = new GameObject("FunctionDelay", components); var functionTimer = new FunctionDelay(action, timer, tag, gameObject); gameObject.GetComponent <MonoBehaviorHook>().SetAction(functionTimer.Update); timers.Add(functionTimer); }
/*------------------------------------------------------------------*\ |* Class level \*------------------------------------------------------------------*/ private static void RemoveTimer(FunctionDelay functionDelay) { timers.Remove(functionDelay); }