UI 이벤트 추가

This commit is contained in:
2026-01-25 23:45:33 +09:00
parent 8b013830a0
commit 698300d465
7 changed files with 61 additions and 11 deletions

View File

@@ -2,6 +2,17 @@ using UnityEngine;
public class Util
{
public static T GetOrAddComponent<T>(GameObject go) where T : UnityEngine.Component
{
T component = go.GetComponent<T>();
if (component == null)
{
component = go.AddComponent<T>();
}
return component;
}
public static GameObject FindChild(GameObject go, string name = null, bool recursive = false)
{
Transform transform = FindChild<Transform>(go, name, recursive);