Example #1
0
        /// <summary>
        /// Resets the peaks. If there is a spectrum profile asset, then the peaks will be loaded from there.
        /// </summary>
        void ResetPeaks()
        {
            if (peaksProfile && !peaksProfile.isDirty && peakLevels != null)
            {
                peaksProfile.GetPeaks(ref peakLevels, ref _peakLevel);

                //Debug.Log("Using Profile: " + peaksProfile.name);
            }
            else
            {
                if (peakLevels != null && peakLevels.Length == bands)
                {
                    for (int i = 0; i < bands; i++)
                    {
                        peakLevels[i] = 0.001f;
                    }
                }

                _peakLevel = 0.001f;
            }
        }