Example #1
0
        public IEnumerator PlayTreeRoutine()
        {
            _treeBranchPlayer = new BranchPlayer(Tree.EntryNode?.TaskImplementation);
            _treeBranchPlayer.Start();
            yield return(new WaitUntil(() => !_treeBranchPlayer.IsRunning));

            yield return(null);
        }
Example #2
0
        protected override IEnumerator TaskRoutine()
        {
            _mainBranch = PlayConnectedBranch(0);

            for (int i = 1; i < Connections.Count; i++)
            {
                StartCoroutine(ParallelBranchRoutine(i));
            }

            yield return(new WaitUntil(() => !_mainBranch.IsRunning));

            StopAllCoroutines();
            StopAllBranches();
            Succeed = _mainBranch.BranchSucceed;
        }
Example #3
0
        protected override IEnumerator TaskRoutine()
        {
            bool anySucceed = false;

            for (int i = 0; i < Connections.Count; i++)
            {
                _branchPlayer = PlayConnectedBranch(i);
                yield return(_branchPlayer.WaitUntilFinished());

                if (_branchPlayer.BranchSucceed)
                {
                    anySucceed = true;
                    break;
                }
            }

            yield return(null);

            Succeed = anySucceed;
        }