Esempio n. 1
0
 private static void AddUIDataBaseToList(UIType iType, UIDataBase uIData)
 {
     if (!UIDataBaseDictionary.ContainsKey(iType))
     {
         UIDataBaseDictionary.Add(iType, uIData);
     }
     else
     {
         Debug.LogWarning("This UIDataBase Hased By Name === " + iType);
     }
 }
Esempio n. 2
0
 private void SaveUIRoot(string dlgName, UIDataBase dlg)
 {
     if (dlg)
     {
         dicDlg.Add(dlgName, dlg);
     }
     else
     {
         GameObject.Destroy(dlg.gameObject);
     }
 }
Esempio n. 3
0
    //需要手动注册脚本
    private UIDataBase RegisterDlgScripte(string dlgName, out GameObject uiRoot)
    {
        UIDataBase dlg = null;

        uiRoot = null;
        if (!string.IsNullOrEmpty(dlgName))
        {
            uiRoot = SetRootPro(dlgName);
            switch (dlgName)
            {
            case "": break;
            }
            SaveUIRoot(dlgName, dlg);
        }
        return(dlg);
    }
Esempio n. 4
0
    private UIDataBase GetDigLog(string dlgName)
    {
        if (string.IsNullOrEmpty(dlgName))
        {
            return(null);
        }
        UIDataBase dlg    = null;
        GameObject uiRoot = null;
        bool       isHas  = dicDlg.TryGetValue(dlgName, out dlg);

        if (isHas)
        {
            uiRoot = dlg.gameObject;
        }
        else
        {
            dlg = RegisterDlgScripte(dlgName, out uiRoot);
        }
        SetUIRootParent(uiRoot, dlg.ShowPos);
        return(dlg);
    }