@@ -8,6 +8,7 @@ namespace UnityEditor.PostProcessing
88{
99 using Settings = ColorGradingModel . Settings ;
1010 using Tonemapper = ColorGradingModel . Tonemapper ;
11+ using ColorWheelMode = ColorGradingModel . ColorWheelMode ;
1112
1213 [ PostProcessingModelEditor ( typeof ( ColorGradingModel ) ) ]
1314 public class ColorGradingModelEditor : PostProcessingModelEditor
@@ -48,6 +49,7 @@ struct ChannelMixerSettings
4849
4950 struct ColorWheelsSettings
5051 {
52+ public SerializedProperty mode ;
5153 public SerializedProperty log ;
5254 public SerializedProperty linear ;
5355 }
@@ -138,6 +140,7 @@ public override void OnEnable()
138140 // Color wheels
139141 m_ColorWheels = new ColorWheelsSettings
140142 {
143+ mode = FindSetting ( ( Settings x ) => x . colorWheels . mode ) ,
141144 log = FindSetting ( ( Settings x ) => x . colorWheels . log ) ,
142145 linear = FindSetting ( ( Settings x ) => x . colorWheels . linear )
143146 } ;
@@ -400,15 +403,28 @@ void DoChannelMixerGUI()
400403
401404 void DoColorWheelsGUI ( )
402405 {
403- EditorGUILayout . Space ( ) ;
404- EditorGUILayout . PropertyField ( m_ColorWheels . linear ) ;
405- var rect = GUILayoutUtility . GetLastRect ( ) ;
406- WheelSetTitle ( rect , "Linear Controls" ) ;
407-
408- EditorGUILayout . Space ( ) ;
409- EditorGUILayout . PropertyField ( m_ColorWheels . log ) ;
410- rect = GUILayoutUtility . GetLastRect ( ) ;
411- WheelSetTitle ( rect , "Log Controls" ) ;
406+ int wheelMode = m_ColorWheels . mode . intValue ;
407+
408+ using ( new EditorGUILayout . HorizontalScope ( ) )
409+ {
410+ GUILayout . Space ( 15 ) ;
411+ if ( GUILayout . Toggle ( wheelMode == ( int ) ColorWheelMode . Linear , "Linear" , EditorStyles . miniButtonLeft ) ) wheelMode = ( int ) ColorWheelMode . Linear ;
412+ if ( GUILayout . Toggle ( wheelMode == ( int ) ColorWheelMode . Log , "Log" , EditorStyles . miniButtonRight ) ) wheelMode = ( int ) ColorWheelMode . Log ;
413+ }
414+
415+ m_ColorWheels . mode . intValue = wheelMode ;
416+ EditorGUILayout . Space ( ) ;
417+
418+ if ( wheelMode == ( int ) ColorWheelMode . Linear )
419+ {
420+ EditorGUILayout . PropertyField ( m_ColorWheels . linear ) ;
421+ WheelSetTitle ( GUILayoutUtility . GetLastRect ( ) , "Linear Controls" ) ;
422+ }
423+ else if ( wheelMode == ( int ) ColorWheelMode . Log )
424+ {
425+ EditorGUILayout . PropertyField ( m_ColorWheels . log ) ;
426+ WheelSetTitle ( GUILayoutUtility . GetLastRect ( ) , "Log Controls" ) ;
427+ }
412428 }
413429
414430 static void WheelSetTitle ( Rect position , string label )
0 commit comments