Ejemplo n.º 1
0
        protected override IEnumerator Succession(IGraphFlow flow)
        {
            _isActive = true;
            foreach (var behaviour in behaviours)
            {
                yield return(HandleTarget(behaviour.OnEnter()));
            }

            while (_isActive)
            {
                if (_noBehaviours)
                {
                    yield return(new ExitState());
                }
                foreach (var behaviour in behaviours)
                {
                    yield return(HandleTarget(behaviour.OnUpdate()));
                }
            }

            foreach (var behaviour in behaviours)
            {
                yield return(HandleTarget(behaviour.OnExit()));
            }
            yield return(FlowOut);
        }