public UIWindowItem(_DBC_UI_LAYOUTDEFINE layout, AssetBundle asset)
    {
        if (layout == null)
        {
            LogManager.LogError("UI Layout Can not be null.");
            return;
        }

        id = layout.nID;
        m_strWindowName     = layout.szName;
        m_strLayoutFileName = layout.szLayout;
        demiseType          = layout.nDemise;

        if (!ParsePos(layout.poss))
        {
            return;
        }

        winGo = null;

        if (asset == null)
        {
            RequestAssets(layout.szLayout);
        }
        else
        {
            HandleWindowDownload(null, asset);
        }
    }
Example #2
0
    public void Init()
    {
        allLayouts = CDataBaseSystem.Instance.GetDataBase <_DBC_UI_LAYOUTDEFINE>((int)DataBaseStruct.DBC_UI_LAYOUTDEFINE);

        if (allLayouts == null || allLayouts.StructDict.Count == 0)
        {
            LogManager.LogWarning("layouts is empty!");
            return;
        }
        foreach (_DBC_UI_LAYOUTDEFINE layout in allLayouts.StructDict.Values)
        {
            if (layout.downImmediately == 1)
            {
                needDownList.Add(layout);
            }
        }

        _DBC_UI_LAYOUTDEFINE common = allLayouts.Search_Index_EQU(0);

        ResourceManager.Me.DownloadAsync(UIWindowItem.UIRoot + common.szLayout, null, CommonWindowDownload);

        _DBC_UI_LAYOUTDEFINE fonts = allLayouts.Search_Index_EQU(2);

        ResourceManager.Me.DownloadAsync(UIWindowItem.UIRoot + fonts.szLayout, null, FontsDownload);

        // 这里是为了初始化Icon管理器 [2/17/2012 Ivan]
        _DBC_UI_LAYOUTDEFINE icon = allLayouts.Search_Index_EQU(1);

        IconManager.Instance.Init(UIWindowItem.UIRoot + icon.szLayout);
    }
Example #3
0
 public void AskDownNextWin()
 {
     if (currentIndex < needDownList.Count)
     {
         _DBC_UI_LAYOUTDEFINE layout = needDownList[currentIndex++];
         AskWindowDown(layout.szName);
     }
 }
 public UIWindowItem(_DBC_UI_LAYOUTDEFINE layout) : this(layout, null)
 {
 }