Skip to content

Commit b56f347

Browse files
committed
Added some comments for clarity
1 parent c5ef3b8 commit b56f347

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Scripts/Editor/Core/CollectionItemDropdown.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public CollectionItemDropdown(AdvancedDropdownState state, Type targetItemType,
3737
if (!string.IsNullOrEmpty(options.ValidateMethod))
3838
validationMethod = owner.GetType().GetMethod(options.ValidateMethod, new[] {itemType});
3939

40+
// If it's specified that a callback should be fired when an item is selected, cache that callback.
4041
if (!string.IsNullOrEmpty(options.OnSelectCallbackMethod))
4142
{
4243
onSelectCallbackMethod = owner.GetType().GetMethod(options.OnSelectCallbackMethod,

Scripts/Editor/PropertyDrawers/SOCItemPropertyDrawer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ private void DrawCollectionItemDropDown(
216216
bool canUseDropDown = true;
217217
bool isDropdownError = false;
218218

219+
// If the options are meant to be constrained to a specific collection, check if the collection specified
220+
// is valid. If not, draw some useful messages so you're aware what's wrong and know how to fix it.
219221
if (!string.IsNullOrEmpty(OptionsAttribute.ConstrainToCollectionField))
220222
{
221223
SerializedProperty collectionField = property.serializedObject.FindProperty(

0 commit comments

Comments
 (0)