//Draw the sound position based on Balance/Fade data private void RenderSound(LegacySound data, bool selected) { var sndPos = _tableCenter; sndPos.x += _tableSize.x * 0.5f * data.Balance.PercentageToRatio(); sndPos.y -= _tableSize.y * 0.25f; sndPos.z += _tableSize.z * 0.5f * data.Fade.PercentageToRatio(); Color col = selected ? _selectedColor : _unselectedColor; //Disc size based on sound volume var minSphereSize = 0.25f; var maxSphereSize = _tableSize.magnitude * 0.5f; //Volume goes from -100 to 100 -> ratio var sphereSizeRatio = (data.Volume + 100) * 0.005f; var sphereSize = sphereSizeRatio * (maxSphereSize - minSphereSize); col.a = 0.05f; Handles.color = col; Handles.DrawSolidDisc(sndPos, Vector3.up, sphereSize); //Sound Gizmo col.a = selected ? 1.0f : 0.25f; GUI.color = col; Handles.Label(sndPos, _iconContent, _iconStyle); if (selected) { _selectedSoundPos = sndPos; } }
public SoundListData(LegacySound legacySound) { LegacySound = legacySound; }