private void SetBestMatchTransition(string name) { if (_currentlyPlayingComponent != null) { for (int i = 0; i < _transitions.Count; i++) { MusicTransition musicTransition = _transitions[i]; if (musicTransition._fromComponent._component.Name == _currentlyPlayingComponent.Name && musicTransition._toComponent._component.Name == name) { _activeTransition = musicTransition; _musicTransitionState = MusicTransitionState.FromComponent; return; } } } for (int j = 0; j < _components.Count; j++) { Component component = _components[j]; if (component.name == name) { _toComponent = component; break; } } }
private MusicSyncType GetTransitionMusicSyncType(MusicTransition transition, MusicTransitionState state) { switch (state) { case MusicTransitionState.FromComponent: return(transition._fromComponent._musicSyncType); case MusicTransitionState.Transition: return(transition._transition._musicSyncType); case MusicTransitionState.ToComponent: return(transition._toComponent._musicSyncType); default: return(MusicSyncType.OnBar); } }