Unity/Unity(C#์ค๊ธ)
ํ์ฅ๋ฉ์๋
Rainbow๐Coder
2022. 1. 13. 14:39
728x90
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
//ํ์ฅ ๋ฉ์๋ : ๊ธฐ์กด ํด๋์ค ๋ฐ ๋ค๋ฅธ ํด๋์ค์ ์ธ์คํด์ค ๋ฉ์๋๋ฅผ ์ถ๊ฐํ ์ ์์ด, ๊ธฐ๋ฅ์ ํ์ฅํ๋ ๊ธฐ๋ฒ
//์กฐ๊ฑด 1 : static ํด๋์ค์ฌ์ผ ํ ๊ฒ(MonoBehaviour๋ ํ์์์ผ๋ฏ๋ก ์์ ์ ๊ฑฐ)
public static class Extension
{
//์ฒซ๋ฒ์งธ ๋งค๊ฐ ๋ณ์ : ํ์ฅํ๋ ค๊ณ ํ๋ ๋์
//this ํ์ฅํ ํด๋์ค ๋๋ ํ์
public static void AddUIEvent(this GameObject go, Action<PointerEventData> action, Define.UIEvent type = Define.UIEvent.Click)
{
UIBase.AddUIEvent(go,action, type);
}
public static void PrintData<T>(this T str)
{
Debug.Log(str);
}
}728x90