17 lines
444 B
C#
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);
|
|
}
|
|
}
|