File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Runtime/Scripts/Controls/ComboBox Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,9 @@ public class SelectionTextChangedEvent : Events.UnityEvent<string> { }
131131 [ System . Serializable ]
132132 public class SelectionValidityChangedEvent : Events . UnityEvent < bool > { }
133133
134+ [ System . Serializable ]
135+ public class ItemSelectedEvent : Events . UnityEvent < string > { }
136+
134137 [ System . Serializable ]
135138 public class ControlDisabledEvent : Events . UnityEvent < bool > { }
136139
@@ -141,6 +144,8 @@ public class ControlDisabledEvent : Events.UnityEvent<bool> { }
141144 public SelectionValidityChangedEvent OnSelectionValidityChanged ;
142145 // fires in both cases
143146 public SelectionChangedEvent OnSelectionChanged ;
147+ // fires when an item is clicked
148+ public ItemSelectedEvent OnItemSelected ;
144149 // fires when item is changed;
145150 public ControlDisabledEvent OnControlDisabled ;
146151
@@ -358,10 +363,10 @@ private void RebuildPanel()
358363 /// <param name="item"></param>
359364 private void OnItemClicked ( string item )
360365 {
361- //Debug.Log("item " + item + " clicked");
362366 Text = item ;
363367 _mainInput . text = Text ;
364368 ToggleDropdownPanel ( true ) ;
369+ OnItemSelected ? . Invoke ( Text ) ;
365370 }
366371
367372 private void RedrawPanel ( )
You can’t perform that action at this time.
0 commit comments