public static WebRequest GetWebRequest(string url, Action <string, bool, Exception> handler) { WebRequest webRequest = AppManager.AddWorker <WebRequest>(); webRequest.Handler = handler; webRequest.Url = url; return(webRequest); }
public static Timer Once(Action handler, float timeout) { Timer timer = AppManager.AddWorker <Timer>(); timer.Handler = handler; timer.TotalSeconds = timeout; return(timer); }
public void Awake() { AppManager.AddWorker <NetworkManager>(); AppManager.AddWorker <ConsoleManager>(); ConsoleManager.RegisterConsoleHandler(OnConsoleCommand); // Строчка для ленивых, что бы каждый раз не писать конект в консоли Timer.Once(() => OnConsoleCommand("connect 212.22.93.83:28015"), 2f); }
public static Timer Repeat(Action handler, float timeout) { Timer timer = AppManager.AddWorker <Timer>(); timer.Handler = handler; timer.TotalSeconds = timeout; timer.CanRepeat = true; return(timer); }