Example #1
0
 private void SendAudioAnaylisToParticleVisualizer()
 {
     if (audioAnalysis != null)
     {
         particleVisualizer.SendAnalysis(audioAnalysis);
     }
 }
    public void PlaySomething()
    {
        if (transform.tag == "song")
        {
            playSong();

            if (audioAnalysisCustom != null)
            {
                if (audioAnalysisCustom.beatsPerSecond != 0)
                {
                    Debug.Log("Using saved audio analysis!!");
                    particleVisualizer.SendAnalysis(audioAnalysisCustom);
                }
            }
            else
            {
                Debug.Log("Null audio analysis, stopping coroutines");
                particleVisualizer.StopAllCoroutines();
            }
        }
        else if (transform.tag == "artist")
        {
            playArtist();

            if (audioAnalysisCustom != null)
            {
                if (audioAnalysisCustom.beatsPerSecond != 0)
                {
                    Debug.Log("Using saved audio analysis!!");
                    particleVisualizer.SendAnalysis(audioAnalysisCustom);
                }
            }
            else
            {
                Debug.Log("Null audio analysis, stopping coroutines");
                particleVisualizer.StopAllCoroutines();
            }
        }
        else
        {
            playPlaylist();

            Debug.Log("No audio analysis, stopping coroutines");
            particleVisualizer.StopAllCoroutines();
        }
    }