RunOnMainThread() публичный статический Метод

Schedules the action to run on the main thread
public static RunOnMainThread ( System.Action action ) : void
action System.Action
Результат void
Пример #1
0
        /// <summary>
        /// Executes the task on the main thread
        /// </summary>
        protected void RunOnMainThread()
        {
            Status = TaskStatus.Running;
#if UNITY_WEBGL
            Execute();
#else
            TaskManager.RunOnMainThread(Execute);
#endif
        }
Пример #2
0
        /// <summary>
        /// Creates a new background Task strategy
        /// </summary>
        /// <param name="function"></param>
        public UnityTask(Func <TResult> function)
            : this()
        {
            if (function == null)
            {
                throw new ArgumentNullException("function");
            }

            _function = function;
            Status    = TaskStatus.Running;
#if UNITY_WEBGL
            Execute();
#else
            TaskManager.RunOnMainThread(Execute);
#endif
        }
Пример #3
0
        /// <summary>
        /// Creates a new background Task strategy
        /// </summary>
        public UnityTask(Delegate function, object param)
            : this()
        {
            if (function == null)
            {
                throw new ArgumentNullException("function");
            }

            _function2 = function;
            Paramater  = param;
            Status     = TaskStatus.Running;
#if UNITY_WEBGL
            Execute();
#else
            TaskManager.RunOnMainThread(Execute);
#endif
        }
Пример #4
0
 protected void RunOnMainThread()
 {
     Status = TaskStatus.Pending;
     TaskManager.RunOnMainThread(Execute);
 }