예제 #1
0
        public static WebRequest GetWebRequest(string url, Action <string, bool, Exception> handler)
        {
            WebRequest webRequest = AppManager.AddWorker <WebRequest>();

            webRequest.Handler = handler;
            webRequest.Url     = url;

            return(webRequest);
        }
예제 #2
0
        public static Timer Once(Action handler, float timeout)
        {
            Timer timer = AppManager.AddWorker <Timer>();

            timer.Handler      = handler;
            timer.TotalSeconds = timeout;

            return(timer);
        }
예제 #3
0
        public void Awake()
        {
            AppManager.AddWorker <NetworkManager>();
            AppManager.AddWorker <ConsoleManager>();
            ConsoleManager.RegisterConsoleHandler(OnConsoleCommand);

            // Строчка для ленивых, что бы каждый раз не писать конект в консоли
            Timer.Once(() => OnConsoleCommand("connect 212.22.93.83:28015"), 2f);
        }
예제 #4
0
        public static Timer Repeat(Action handler, float timeout)
        {
            Timer timer = AppManager.AddWorker <Timer>();

            timer.Handler      = handler;
            timer.TotalSeconds = timeout;
            timer.CanRepeat    = true;

            return(timer);
        }