示例#1
0
    public T CreateHUDUI <T>(string resName) where T : UIBase
    {
        //Debug.Log(resName);

        GameObject res = Resources.Load <GameObject>(GlobalUtil.AddString(_hudPath, resName));

        GameObject obj = Instantiate(res);

        obj.transform.SetParent(HudUI, false);
        T callUI = obj.GetComponent <T>();

        if (callUI)
        {
            _hudManager.AddHUDUI(callUI);
        }

        return(callUI);
    }