Files
MMORPG/Assets/Scripts/Utils/Extension.cs
2026-01-27 00:34:47 +09:00

17 lines
444 B
C#

using System;
using UnityEngine;
using UnityEngine.EventSystems;
public static class Extension
{
public static T GetOrAddComponent<T>(this GameObject go) where T : UnityEngine.Component
{
return Util.GetOrAddComponent<T>(go);
}
public static void AddUIEvent(this GameObject go, Action<PointerEventData> action, Define.UIEvent type = Define.UIEvent.Click)
{
UI_Base.BindEvent(go, action, type);
}
}