From 70661a48237f445d18755e1f2fbf6af1d0de4044 Mon Sep 17 00:00:00 2001 From: Simon Jackson Date: Sun, 1 Jan 2023 13:29:53 +0000 Subject: [PATCH] Updated "Action" use to "UnityAction" to avoid Unity issues Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/253 --- Runtime/Scripts/Controls/ComboBox/DropDownListItem.cs | 9 +++++---- Runtime/Scripts/Utilities/UI_MagneticInfiniteScroll.cs | 7 +++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Runtime/Scripts/Controls/ComboBox/DropDownListItem.cs b/Runtime/Scripts/Controls/ComboBox/DropDownListItem.cs index e89eeeb..7c4c027 100644 --- a/Runtime/Scripts/Controls/ComboBox/DropDownListItem.cs +++ b/Runtime/Scripts/Controls/ComboBox/DropDownListItem.cs @@ -2,6 +2,7 @@ ///Sourced from - http://forum.unity3d.com/threads/receive-onclick-event-and-pass-it-on-to-lower-ui-elements.293642/ using System; +using UnityEngine.Events; namespace UnityEngine.UI.Extensions { @@ -76,9 +77,9 @@ namespace UnityEngine.UI.Extensions set { _id = value; } } - public Action OnSelect = null; //action to be called when this item is selected + public UnityAction OnSelect = null; //action to be called when this item is selected - internal Action OnUpdate = null; //action to be called when something changes. + internal UnityAction OnUpdate = null; //action to be called when something changes. /// /// Constructor for Drop Down List panelItems @@ -87,8 +88,8 @@ namespace UnityEngine.UI.Extensions /// ID of the item /// /// Should the item start disabled - /// Action to be called when this item is selected - public DropDownListItem(string caption = "", string inId = "", Sprite image = null, bool disabled = false, Action onSelect = null) + /// UnityAction to be called when this item is selected + public DropDownListItem(string caption = "", string inId = "", Sprite image = null, bool disabled = false, UnityAction onSelect = null) { _caption = caption; _image = image; diff --git a/Runtime/Scripts/Utilities/UI_MagneticInfiniteScroll.cs b/Runtime/Scripts/Utilities/UI_MagneticInfiniteScroll.cs index f6ca3ff..2998483 100644 --- a/Runtime/Scripts/Utilities/UI_MagneticInfiniteScroll.cs +++ b/Runtime/Scripts/Utilities/UI_MagneticInfiniteScroll.cs @@ -1,10 +1,9 @@ /// Credit Febo Zodiaco /// Sourced from - https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/349/magnticinfinitescroll -/// -using System; using System.Collections; using System.Collections.Generic; +using UnityEngine.Events; using UnityEngine.EventSystems; namespace UnityEngine.UI.Extensions @@ -13,7 +12,7 @@ namespace UnityEngine.UI.Extensions [RequireComponent(typeof(ScrollRect))] public class UI_MagneticInfiniteScroll : UI_InfiniteScroll, IDragHandler, IEndDragHandler, IScrollHandler { - public event Action OnNewSelect; + public event UnityAction OnNewSelect; [Tooltip("The pointer to the pivot, the visual element for centering objects.")] [SerializeField] @@ -197,4 +196,4 @@ namespace UnityEngine.UI.Extensions FinishPrepareMovement(); } } -} +} \ No newline at end of file