protected override IEnumerator Execution()
        {
            SetStatus(TaskStatus.InProgress);
            //Debug.Log("Starting task " + Name);
            if (!CheckPreConditions())
            {
                SetStatus(TaskStatus.Failure);
                yield break;
            }

            taskAction.Invoke();

            while (Status != TaskStatus.Complete)
            {
                if (!CheckTaskIntegrity())
                {
                    SetStatus(TaskStatus.Failure);
                    yield break;
                }

                if (CheckEndTask())
                {
                    SetStatus(TaskStatus.Complete);
                    //Debug.Log(Name + " Complete");
                }

                yield return(null);
            }
        }
コード例 #2
0
 private void OnTaskDone(bool param)
 {
     TaskOpen = false;
     TaskAction?.Invoke(param);
     RaiseCanExecuteChanged();
 }