예제 #1
0
        public void ContinueOnUIThread(Action <ThreadJob> action)
        {
            Action _action = () =>
            {
                action(this);
            };

            _nextJob = new UIThreadJob(_action);
        }
예제 #2
0
        public ThreadJob <TResult> ContinueWith <TResult>(Func <ThreadJob, TResult> func)
        {
            Func <TResult> _func = () =>
            {
                return(func(this));
            };
            ThreadJob <TResult> job = new ThreadJob <TResult>(_func);

            _nextJob = job;

            return(job);
        }
예제 #3
0
        public ThreadJob ContinueWith(Action <ThreadJob> action)
        {
            Action _action = () =>
            {
                try
                {
                    action(this);
                }
                catch (Exception e)
                {
                    Debug.LogError("UnityTask Excepetion Message: " + e.Message);
                    State = ThreadJobState.Faulted;

                    throw;
                }
            };
            ThreadJob job = new ThreadJob(_action);

            _nextJob = job;

            return(job);
        }