mirror of
https://github.com/AnnulusGames/Alchemy.git
synced 2025-01-22 00:08:53 -05:00
Fix: OnListViewChanged events for 2021
This commit is contained in:
parent
d6ead526bf
commit
df3f0a13c6
@ -88,7 +88,7 @@ namespace Alchemy.Editor
|
||||
if (events.OnItemsChosen == null) return;
|
||||
ReflectionHelper.Invoke(target, events.OnItemsChosen, new object[] { items });
|
||||
};
|
||||
#elif UNITY_2022_1_OR_NEWER
|
||||
#else
|
||||
listView.onItemsChosen += items =>
|
||||
{
|
||||
if (events.OnItemsChosen == null) return;
|
||||
@ -113,8 +113,8 @@ namespace Alchemy.Editor
|
||||
if (events.OnSelectedIndicesChanged== null) return;
|
||||
ReflectionHelper.Invoke(target, events.OnSelectedIndicesChanged, new object[] { indices });
|
||||
};
|
||||
#elif UNITY_2022_1_OR_NEWER
|
||||
listView.onSelectionChanged += items =>
|
||||
#else
|
||||
listView.onSelectionChange += items =>
|
||||
{
|
||||
if (events.OnSelectionChanged == null) return;
|
||||
ReflectionHelper.Invoke(target, events.OnSelectionChanged, new object[] { items });
|
||||
|
@ -225,13 +225,13 @@ namespace Alchemy.Inspector
|
||||
public string OnItemIndexChanged { get; set; }
|
||||
public string OnItemsAdded { get; set; }
|
||||
public string OnItemsRemoved { get; set; }
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
|
||||
public string OnItemsChosen { get; set; }
|
||||
#endif
|
||||
|
||||
public string OnItemsSourceChanged { get; set; }
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
|
||||
public string OnSelectionChanged { get; set; }
|
||||
public string OnSelectedIndicesChanged { get; set; }
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
@ -8,10 +8,7 @@ public class OnListViewChangedTest : MonoBehaviour
|
||||
OnItemChanged = nameof(OnItemChanged),
|
||||
OnItemsAdded = nameof(OnItemsAdded),
|
||||
OnItemsRemoved = nameof(OnItemsRemoved),
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
OnSelectedIndicesChanged = nameof(OnSelectedIndicesChanged),
|
||||
#endif
|
||||
|
||||
OnItemIndexChanged = nameof(OnItemIndexChanged))
|
||||
]
|
||||
public int[] array;
|
||||
@ -30,12 +27,12 @@ public class OnListViewChangedTest : MonoBehaviour
|
||||
{
|
||||
Debug.Log($"Removed: [{string.Join(',', indices)}]");
|
||||
}
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
|
||||
void OnSelectedIndicesChanged(IEnumerable<int> indices)
|
||||
{
|
||||
Debug.Log($"Selected: [{string.Join(',', indices)}]");
|
||||
}
|
||||
#endif
|
||||
|
||||
void OnItemIndexChanged(int before, int after)
|
||||
{
|
||||
Debug.Log($"Index Changed: [{before} -> {after}]");
|
||||
|
Loading…
Reference in New Issue
Block a user