Beispiel #1
0
    public void HideUI(UI_MEMBER_LIST uiName)
    {
        GameObject targetUI = null;

        if (_scenePopups.ContainsKey(uiName))
        {
            targetUI = _scenePopups[uiName];
        }
        else if (_scenePanels.ContainsKey(uiName))
        {
            targetUI = _scenePanels[uiName];
        }
        else if (_commonPopups.ContainsKey(uiName))
        {
            targetUI = _commonPopups[uiName];
        }
        else if (_commonPanels.ContainsKey(uiName))
        {
            targetUI = _commonPanels[uiName];
        }

        if (targetUI != null)
        {
            targetUI.SetActive(false);
        }
        else
        {
            Debug.LogErrorFormat("Not Found UI -> {0}", uiName.ToString());
        }
    }
Beispiel #2
0
    GameObject LoadUI(UI_MEMBER_LIST uiName)
    {
        string asset_name      = uiName.ToString();
        string asset_full_path = "";

#if UNITY_EDITOR
        if (ui_path_name.TryGetValue(asset_name, out asset_full_path) == false)
        {
            Debug.LogErrorFormat("Can not Find UI Asset : {0}", asset_name);
        }
#endif
        GameObject prefab = AT.AssetManager.AssetManager.Instance.LoadAsset <GameObject>(AT.AssetManager.AssetManager.PREFAB_UI, asset_name, asset_full_path);
        if (prefab == null)
        {
            return(null);
        }

        GameObject go = null;
        if (UI_MEMBER_LIST.SCENE_POPUP < uiName && uiName < UI_MEMBER_LIST.MAX_SCENE_POPUP)
        {
            go = NGUITools.AddChild(_trScenePopup.gameObject, prefab);
            _scenePopups[uiName] = go;
        }

        else if (UI_MEMBER_LIST.SCENE_PANEL < uiName && uiName < UI_MEMBER_LIST.MAX_SCENE_PANEL)
        {
            go = NGUITools.AddChild(_trScenePanel.gameObject, prefab);
            _scenePanels[uiName] = go;
        }

        go.SetActive(false);
        return(go);
    }