LazyBot/Assets/Scripts/Visualizer/AudioSourceVisualizer.cs
/// <summary>
/// Draws circle, that represents audibility or loudness of audio.
/// </summary>
/// <param name="innerRadius">Minimal raius.</param>
/// <param name="outherRadius">Maximal radius.</param>
Draws circle, that represents audibility or loudness of audio.
Draws circle that represents audibility or loudness of audio .
private void DrawZone(float innerRadius, float outherRadius)
        {
#if UNITY_EDITOR
            if (_vizualize)
            {
                float progress;
                float stepLength = (outherRadius - innerRadius) / _step;
                for (float i = outherRadius; i >= innerRadius; i -= stepLength)
                {
                    progress = 1 - LazyBot.Utility.Data.FloatHelper.Map(i, innerRadius, outherRadius, 0, 1);
                    UnityEditor.Handles.color = new Color(
                        Mathf.Lerp(_colorNoiseBad.r, _colorNoiseGood.r, progress),
                        Mathf.Lerp(_colorNoiseBad.g, _colorNoiseGood.g, progress),
                        Mathf.Lerp(_colorNoiseBad.b, _colorNoiseGood.b, progress), _alpha);
                    UnityEditor.Handles.DrawSolidArc(transform.position, transform.up, -transform.right, 360, i);
                }
            }
            else
            {
                UnityEditor.Handles.color = _colorZone;
                UnityEditor.Handles.DrawWireArc(transform.position,
                    Vector3.up, Vector3.forward, 360, innerRadius);
                UnityEditor.Handles.DrawWireArc(transform.position,
                    Vector3.up, Vector3.forward, 360, outherRadius);
            }
#endif
        }
private void DrawZone ( float innerRadius , float outherRadius ) { if UNITY_EDITOR if ( _vizualize ) { float progress ; float stepLength = ( outherRadius - innerRadius ) / _step ; for ( float i = outherRadius ; i >= innerRadius ; i -= stepLength ) { progress = 1 - LazyBot . Utility . Data . FloatHelper . Map ( i , innerRadius , outherRadius , 0 , 1 ) ; UnityEditor . Handles . color = new Color ( Mathf . Lerp ( _colorNoiseBad . r , _colorNoiseGood . r , progress ) , Mathf . Lerp ( _colorNoiseBad . g , _colorNoiseGood . g , progress ) , Mathf . Lerp ( _colorNoiseBad . b , _colorNoiseGood . b , progress ) , _alpha ) ; UnityEditor . Handles . DrawSolidArc ( transform . position , transform . up , - transform . right , 360 , i ) ; } } else { UnityEditor . Handles . color = _colorZone ; UnityEditor . Handles . DrawWireArc ( transform . position , Vector3 . up , Vector3 . forward , 360 , innerRadius ) ; UnityEditor . Handles . DrawWireArc ( transform . position , Vector3 . up , Vector3 . forward , 360 , outherRadius ) ; } endif }
Draws circle, that represents audibility or loudness of audio.
Draws circle that represents audibility or loudness of audio .
innerRadius
float
None
outherRadius
float
None