public override EventStatus OnProcessEvent(Fabric.Event zEvent, ComponentInstance zInstance) { EventStatus result = EventStatus.Failed_Uknown; if (zEvent.EventAction == EventAction.AdvanceSequence && _sequenceType == SequenceComponentType.PlayOnAdvance) { List <ComponentInstance> list = null; if (_syncAdvanceBetweenInstances) { list = new List <ComponentInstance>(_componentInstances.Length); for (int i = 0; i < _componentInstances.Length; i++) { list.Add(_componentInstances[i]); } } else { list = FindInstances(zEvent.parentGameObject, createIfNoneFound: false); } if (list != null && list.Count > 0) { for (int j = 0; j < list.Count; j++) { ComponentInstance componentInstance = list[j]; if (!((SequenceComponent)componentInstance._instance)._stopInProgress) { if ((_playlistPlayToEnd[_prevPlayingComponentIndex] || IsMusicSyncEnabled()) && _currentlyPlayingComponent != null && _currentlyPlayingComponent.IsPlaying()) { ((SequenceComponent)componentInstance._instance)._advanceEventTriggered = true; continue; } ((SequenceComponent)componentInstance._instance).PlayNextEntry(); result = EventStatus.Handled; if (HasValidEventNotifier()) { NotifyEvent(EventNotificationType.OnSequenceAdvance, _currentlyPlayingComponent); } } else { result = EventStatus.Not_Handled_Stopped; } } } else { PlayNextEntry(); result = EventStatus.Handled; } } else if (zEvent.EventAction == EventAction.ResetSequence) { List <ComponentInstance> list2 = FindInstances(zEvent.parentGameObject, createIfNoneFound: false); if (list2 != null && list2.Count > 0) { for (int k = 0; k < list2.Count; k++) { ComponentInstance componentInstance2 = list2[k]; ((SequenceComponent)componentInstance2._instance).ResetSequence(); result = EventStatus.Handled; } } else { ResetSequence(); result = EventStatus.Handled; } } return(result); }