UI 이벤트 추가
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user