mirror of
https://github.com/AnnulusGames/Alchemy.git
synced 2025-01-22 00:08:53 -05:00
Fix: #if 2022.2 to 2022.1
This commit is contained in:
parent
a2e588ef38
commit
a509a7ba83
@ -103,7 +103,7 @@ namespace Alchemy.Editor.Elements
|
||||
|
||||
else if (type == typeof(uint))
|
||||
{
|
||||
#if UNITY_2022_2_OR_NEWER
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
AddField(new UnsignedIntegerField(label), (uint)obj);
|
||||
#else
|
||||
var value = (uint)obj;
|
||||
@ -126,7 +126,7 @@ namespace Alchemy.Editor.Elements
|
||||
}
|
||||
else if (type == typeof(ulong))
|
||||
{
|
||||
#if UNITY_2022_2_OR_NEWER
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
AddField(new UnsignedLongField(label), (ulong)obj);
|
||||
#else
|
||||
var value = (ulong)obj;
|
||||
|
@ -82,7 +82,7 @@ namespace Alchemy.Editor
|
||||
if (events.OnItemsRemoved == null) return;
|
||||
ReflectionHelper.Invoke(target, events.OnItemsRemoved, new object[] { indices });
|
||||
};
|
||||
#if UNITY_2022_2_OR_NEWER
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
listView.itemsChosen += items =>
|
||||
{
|
||||
if (events.OnItemsChosen == null) return;
|
||||
@ -101,7 +101,7 @@ namespace Alchemy.Editor
|
||||
if (events.OnItemIndexChanged == null) return;
|
||||
ReflectionHelper.Invoke(target, events.OnItemIndexChanged, new object[] { before, after });
|
||||
};
|
||||
#if UNITY_2022_2_OR_NEWER
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
listView.selectionChanged += items =>
|
||||
{
|
||||
if (events.OnSelectionChanged == null) return;
|
||||
|
@ -8,6 +8,8 @@ public class OnListViewChangedTest : MonoBehaviour
|
||||
OnItemChanged = nameof(OnItemChanged),
|
||||
OnItemsAdded = nameof(OnItemsAdded),
|
||||
OnItemsRemoved = nameof(OnItemsRemoved),
|
||||
OnItemsChosen = nameof(OnItemChosen),
|
||||
OnSelectionChanged = nameof(OnSelectionChanged),
|
||||
OnSelectedIndicesChanged = nameof(OnSelectedIndicesChanged),
|
||||
OnItemIndexChanged = nameof(OnItemIndexChanged))
|
||||
]
|
||||
@ -28,6 +30,16 @@ public class OnListViewChangedTest : MonoBehaviour
|
||||
Debug.Log($"Removed: [{string.Join(',', indices)}]");
|
||||
}
|
||||
|
||||
void OnItemChosen(IEnumerable<object> items)
|
||||
{
|
||||
Debug.Log($"Chosen: [{string.Join(',', items)}]");
|
||||
}
|
||||
|
||||
void OnSelectionChanged(IEnumerable<object> items)
|
||||
{
|
||||
Debug.Log($"Selection Changed: [{string.Join(',', items)}]");
|
||||
}
|
||||
|
||||
void OnSelectedIndicesChanged(IEnumerable<int> indices)
|
||||
{
|
||||
Debug.Log($"Selected: [{string.Join(',', indices)}]");
|
||||
|
Loading…
Reference in New Issue
Block a user