@@ -30,7 +30,7 @@ public InputControlPathEditor(SerializedProperty pathProperty, InputControlPicke
30
30
{
31
31
if ( pathProperty == null )
32
32
throw new ArgumentNullException ( nameof ( pathProperty ) ) ;
33
-
33
+ Debug . Log ( $ "New Path Property on { pathProperty . serializedObject . targetObject . GetInstanceID ( ) } " ) ;
34
34
this . pathProperty = pathProperty ;
35
35
this . onModified = onModified ;
36
36
m_PickerState = pickerState ?? new InputControlPickerState ( ) ;
@@ -78,10 +78,9 @@ public void OnGUI()
78
78
EditorGUILayout . EndHorizontal ( ) ;
79
79
}
80
80
81
- public void OnGUI ( Rect rect , GUIContent label = null , SerializedProperty property = null , Action modifiedCallback = null )
81
+ public void OnGUI ( Rect rect , GUIContent label = null , Action modifiedCallback = null )
82
82
{
83
83
var pathLabel = label ?? m_PathLabel ;
84
- var serializedProperty = property ?? pathProperty ;
85
84
86
85
var lineRect = rect ;
87
86
var labelRect = lineRect ;
@@ -103,7 +102,7 @@ public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty propert
103
102
var path = String . Empty ;
104
103
try
105
104
{
106
- path = serializedProperty . stringValue ;
105
+ path = pathProperty . stringValue ;
107
106
}
108
107
catch
109
108
{
@@ -128,8 +127,8 @@ public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty propert
128
127
path = EditorGUI . DelayedTextField ( bindingTextRect , path ) ;
129
128
if ( EditorGUI . EndChangeCheck ( ) )
130
129
{
131
- serializedProperty . stringValue = path ;
132
- serializedProperty . serializedObject . ApplyModifiedProperties ( ) ;
130
+ pathProperty . stringValue = path ;
131
+ pathProperty . serializedObject . ApplyModifiedProperties ( ) ;
133
132
( modifiedCallback ?? onModified ) . Invoke ( ) ;
134
133
}
135
134
}
@@ -138,9 +137,9 @@ public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty propert
138
137
// Dropdown that shows binding text and allows opening control picker.
139
138
if ( EditorGUI . DropdownButton ( bindingTextRect , new GUIContent ( displayName ) , FocusType . Keyboard ) )
140
139
{
141
- SetExpectedControlLayoutFromAttribute ( serializedProperty ) ;
140
+ SetExpectedControlLayoutFromAttribute ( pathProperty ) ;
142
141
////TODO: for bindings that are part of composites, use the layout information from the [InputControl] attribute on the field
143
- ShowDropdown ( bindingTextRect , serializedProperty , modifiedCallback ?? onModified ) ;
142
+ ShowDropdown ( bindingTextRect , modifiedCallback ?? onModified ) ;
144
143
}
145
144
}
146
145
@@ -149,7 +148,7 @@ public void OnGUI(Rect rect, GUIContent label = null, SerializedProperty propert
149
148
EditorStyles . miniButton ) ;
150
149
}
151
150
152
- private void ShowDropdown ( Rect rect , SerializedProperty serializedProperty , Action modifiedCallback )
151
+ private void ShowDropdown ( Rect rect , Action modifiedCallback )
153
152
{
154
153
#if UNITY_INPUT_SYSTEM_PROJECT_WIDE_ACTIONS
155
154
InputActionsEditorSettingsProvider . SetIMGUIDropdownVisible ( true , false ) ;
@@ -160,7 +159,8 @@ private void ShowDropdown(Rect rect, SerializedProperty serializedProperty, Acti
160
159
m_PickerState ,
161
160
path =>
162
161
{
163
- serializedProperty . stringValue = path ;
162
+ Debug . Log ( $ "Saving path to property on { pathProperty . serializedObject . targetObject . GetInstanceID ( ) } ") ;
163
+ pathProperty . stringValue = path ;
164
164
m_PickerState . manualPathEditMode = false ;
165
165
modifiedCallback ( ) ;
166
166
} ) ;
0 commit comments