Updated "Action" use to "UnityAction" to avoid Unity issues

Resolves: https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/253
pull/413/head
Simon Jackson 2023-01-01 13:29:53 +00:00
parent eceaa87e93
commit 70661a4823
2 changed files with 8 additions and 8 deletions

View File

@ -2,6 +2,7 @@
///Sourced from - http://forum.unity3d.com/threads/receive-onclick-event-and-pass-it-on-to-lower-ui-elements.293642/ ///Sourced from - http://forum.unity3d.com/threads/receive-onclick-event-and-pass-it-on-to-lower-ui-elements.293642/
using System; using System;
using UnityEngine.Events;
namespace UnityEngine.UI.Extensions namespace UnityEngine.UI.Extensions
{ {
@ -76,9 +77,9 @@ namespace UnityEngine.UI.Extensions
set { _id = value; } 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.
/// <summary> /// <summary>
/// Constructor for Drop Down List panelItems /// Constructor for Drop Down List panelItems
@ -87,8 +88,8 @@ namespace UnityEngine.UI.Extensions
/// <param name="val">ID of the item </param> /// <param name="val">ID of the item </param>
/// <param name="image"></param> /// <param name="image"></param>
/// <param name="disabled">Should the item start disabled</param> /// <param name="disabled">Should the item start disabled</param>
/// <param name="onSelect">Action to be called when this item is selected</param> /// <param name="onSelect">UnityAction to be called when this item is selected</param>
public DropDownListItem(string caption = "", string inId = "", Sprite image = null, bool disabled = false, Action onSelect = null) public DropDownListItem(string caption = "", string inId = "", Sprite image = null, bool disabled = false, UnityAction onSelect = null)
{ {
_caption = caption; _caption = caption;
_image = image; _image = image;

View File

@ -1,10 +1,9 @@
/// Credit Febo Zodiaco /// Credit Febo Zodiaco
/// Sourced from - https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/349/magnticinfinitescroll /// Sourced from - https://bitbucket.org/UnityUIExtensions/unity-ui-extensions/issues/349/magnticinfinitescroll
///
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine.Events;
using UnityEngine.EventSystems; using UnityEngine.EventSystems;
namespace UnityEngine.UI.Extensions namespace UnityEngine.UI.Extensions
@ -13,7 +12,7 @@ namespace UnityEngine.UI.Extensions
[RequireComponent(typeof(ScrollRect))] [RequireComponent(typeof(ScrollRect))]
public class UI_MagneticInfiniteScroll : UI_InfiniteScroll, IDragHandler, IEndDragHandler, IScrollHandler public class UI_MagneticInfiniteScroll : UI_InfiniteScroll, IDragHandler, IEndDragHandler, IScrollHandler
{ {
public event Action<GameObject> OnNewSelect; public event UnityAction<GameObject> OnNewSelect;
[Tooltip("The pointer to the pivot, the visual element for centering objects.")] [Tooltip("The pointer to the pivot, the visual element for centering objects.")]
[SerializeField] [SerializeField]