public static GameObject FindUIGameObject(string UIName) { if (m_CanvasObj == null) { m_CanvasObj = EditorToolKit.FindGameObject("EditorCanvas"); } if (m_CanvasObj == null) { return(null); } return(EditorToolKit.FindChildGameObject(m_CanvasObj, UIName)); }
public static T GetUIComponent <T>(GameObject Container, string UIName) where T : UnityEngine.Component { GameObject ChildGameObject = EditorToolKit.FindChildGameObject(Container, UIName); if (ChildGameObject == null) { return(null); } T tempObj = ChildGameObject.GetComponent <T>(); if (tempObj == null) { Debug.LogWarning("Component[" + UIName + "] is not [" + typeof(T) + "]"); return(null); } return(tempObj); }