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
'Unity > Unity(C#์ค๊ธ)' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋ค์ํ๊ฒ ์์ฑํ ์ ์๋ ๋๋ค์ (0) | 2022.01.12 |
---|---|
์ด๋ฒคํธ (0) | 2021.12.26 |
Delegate (0) | 2021.12.25 |
์ ๋ํฐ Reflection ์ฌ์ฉํ์ฌ ํ ํด๋์ค๋ฅผ ์ปดํฌ๋ํธ๋ก ๊ฐ์ ธ์ค๊ธฐ, ํ ํด๋์ค ์ธ์คํด์ค์ ์ ๊ทผํ๊ธฐ (0) | 2021.12.15 |