// Update is called once per frame private void Update() { if (_bassAnalyzer == null || _midRangeAnalyzer == null || _highRangeAnalyzer == null) { return; } if (!_audioSource.isPlaying) { _audioSource.Play(); StartCoroutine(WaitTest()); } var currentPoint = _audioProcessor.GetCurrentPlayingPointIndex(_audioSource); //can go ahead of song (maybe) //delay song by at least length of lane and spawn on beat detection. Player should only hear second song and beats should line up. //Change Frequencies that are tracked for the lanes to be more 'relevant'; _bassVisualizationBehaviour.VisualizePoint(_bassAnalyzer.SpectralFluxSamples[currentPoint], _bassObj); _bassVisualizationBehaviour.SpawnMonster(_bassAnalyzer.SpectralFluxSamples[currentPoint], objectPooler, "Zombie"); _midRangeVisualizationBehaviour.VisualizePoint(_midRangeAnalyzer.SpectralFluxSamples[currentPoint], _midRangeObj); _midRangeVisualizationBehaviour.SpawnMonster(_midRangeAnalyzer.SpectralFluxSamples[currentPoint], objectPooler, "Skeleton"); _highRangeVisualizationBehaviour.VisualizePoint(_highRangeAnalyzer.SpectralFluxSamples[currentPoint], _highRangeObj); _highRangeVisualizationBehaviour.SpawnMonster(_highRangeAnalyzer.SpectralFluxSamples[currentPoint], objectPooler, "Ghoost"); }
// Update is called once per frame private void Update() { if (_bassAnalyzer == null || _midRangeAnalyzer == null || _highRangeAnalyzer == null) { return; } if (!_audioSource.isPlaying) { _audioSource.Play(); } var currentPoint = _audioProcessor.GetCurrentPlayingPointIndex(_audioSource); _bassVisualizationBehaviour.VisualizePoint(_bassAnalyzer.SpectralFluxSamples[currentPoint], _bassObj); _midRangeVisualizationBehaviour.VisualizePoint(_midRangeAnalyzer.SpectralFluxSamples[currentPoint], _midRangeObj); _highRangeVisualizationBehaviour.VisualizePoint(_highRangeAnalyzer.SpectralFluxSamples[currentPoint], _highRangeObj); }