mirror of
https://github.com/soarqin/DSP_Mods_TO.git
synced 2025-12-20 05:23:28 +08:00
add XianTu
This commit is contained in:
21
XianTu/ToolScripts/EventTriggerExpand.cs
Normal file
21
XianTu/ToolScripts/EventTriggerExpand.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
namespace ToolScripts
|
||||
{
|
||||
internal static class EventTriggerExpand
|
||||
{
|
||||
public static void Add(this EventTrigger trigger, EventTriggerType eventID, UnityAction<BaseEventData> callback)
|
||||
{
|
||||
var flag = trigger.triggers == null;
|
||||
if (flag)
|
||||
{
|
||||
trigger.triggers = [];
|
||||
}
|
||||
var entry = new EventTrigger.Entry();
|
||||
entry.eventID = eventID;
|
||||
entry.callback.AddListener(callback);
|
||||
trigger.triggers.Add(entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user