Ejemplo n.º 1
0
        private System.Collections.IEnumerator DoAutoSequence(IAutoSequenceSignal signal)
        {
            if (signal != null)
            {
                yield return(signal.Wait());

                _currentIndex++;
            }

            while (true)
            {
                int i = this.CurrentIndexNormalized;
                if (i < 0 || i >= _trigger.Targets.Count)
                {
                    yield break;
                }
                _currentIndex++;

                if (_trigger.Targets[i].Target != null && _trigger.Targets[i].Target.GetComponentInChildren <IAutoSequenceSignal>(out signal))
                {
                    var handle = signal.Wait();
                    _trigger.ActivateTriggerAt(i, this, null);
                    yield return(handle);
                }
                else
                {
                    _trigger.ActivateTriggerAt(i, this, null);
                    yield return(null);
                }
            }
        }
        private System.Collections.IEnumerator DoAutoSequence(IAutoSequenceSignal signal)
        {
            if (signal != null)
            {
                yield return(signal.Wait());

                _currentIndex++;
            }

            while (true)
            {
                int i = this.CurrentIndexNormalized;
                if (i < 0 || i >= _trigger.Targets.Count)
                {
                    yield break;
                }
                _currentIndex++;

                //if (_trigger.Targets[i].Target != null && _trigger.Targets[i].Target.GetComponentInChildren<IAutoSequenceSignal>(out signal))
                //{
                //    var handle = signal.Wait();
                //    _trigger.ActivateTriggerAt(i, this, null);
                //    yield return handle;
                //}
                //else
                //{
                //    _trigger.ActivateTriggerAt(i, this, null);
                //    yield return null;
                //}
                var go = GameObjectUtil.GetGameObjectFromSource(_trigger.Targets[i].Target);
                if (go != null && go.GetComponentInChildren <IAutoSequenceSignal>(out signal))
                {
                    var handle = signal.Wait();
                    _trigger.ActivateTriggerAt(i, this, null);
                    yield return(handle);
                }
                else
                {
                    _trigger.ActivateTriggerAt(i, this, null);
                    yield return(null);
                }
            }
        }