Skip to content

Commit 7a5cbe8

Browse files
committed
restored more public api
1 parent a2063c5 commit 7a5cbe8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ public void SetExpectedControlLayout(string expectedControlLayout)
6767
m_ExpectedControlLayout = expectedControlLayout;
6868
m_PickerDropdown?.SetExpectedControlLayout(m_ExpectedControlLayout);
6969
}
70+
71+
public void SetExpectedControlLayoutFromAttribute()
72+
{
73+
var field = pathProperty.GetField();
74+
if (field == null)
75+
return;
76+
77+
var attribute = field.GetCustomAttribute<InputControlAttribute>();
78+
if (attribute != null)
79+
SetExpectedControlLayout(attribute.layout);
80+
}
7081

7182
public void OnGUI()
7283
{

0 commit comments

Comments
 (0)