public static void Draw() { uint position; s_Channel.getPosition(out position, TIMEUNIT.MS); Sound sound; s_Channel.getCurrentSound(out sound); uint length; sound.getLength(out length, TIMEUNIT.MS); var proportion = (float)position / length; var extraSpace = s_BarIsHovered ? 5 : 0; Gizmos.DrawRectangle( new Vector2(0f, MyGameWindow.main.Height - 75f), new Vector2(MyGameWindow.main.Width, MyGameWindow.main.Height - 77f - extraSpace), Color4.BlueViolet, Color4.BlueViolet); Gizmos.DrawRectangle( new Vector2(0f, MyGameWindow.main.Height - 75f), new Vector2(proportion * MyGameWindow.main.Width, MyGameWindow.main.Height - 77f - extraSpace), Color4.White, Color4.White); float volume; s_Channel.getVolume(out volume); proportion = 1 - volume / 1f; extraSpace = s_VolumeIsHovered || s_VolumeIsDragged ? 5 : 0; Gizmos.DrawRectangle( new Vector2(MyGameWindow.main.Width - 225f, MyGameWindow.main.Height - 37f), new Vector2(MyGameWindow.main.Width - 100f, MyGameWindow.main.Height - 40f - extraSpace), Color4.BlueViolet, Color4.BlueViolet); Gizmos.DrawRectangle( new Vector2(MyGameWindow.main.Width - 225f, MyGameWindow.main.Height - 37f), new Vector2( MyGameWindow.main.Width - 100f - proportion * 125f, MyGameWindow.main.Height - 40f - extraSpace), Color4.White, Color4.White); s_Equalizer.Draw(); }