Example #1
0
        //----------------------------------------------------------------------------
        public void LoadNeedRes(UIController ctrl)
        {
            m_ctrl = ctrl;
            var           depsDict = FileSystem.Instance().GetResData().GetResDepsDict();
            List <string> listRes1 = null;

            depsDict.TryGetValue(m_ctrl.viewer.strName, out listRes1);
            m_nMaxNeed = listRes1.Count;
            m_bNoNeedLoadAtlasOrFont = m_nMaxNeed > 0 ? false : true;
            if (m_bNoNeedLoadAtlasOrFont && m_ctrl != null)
            {
                m_ctrl.SetLoadedOK(true);
                return;
            }
            m_nCurCount = 0;
            if (listRes1 != null)
            {
                for (int i = 0; i < listRes1.Count; i++)
                {
                    if (!m_system.LoadUIAsset(listRes1[i], OnLoadNeedOkInLoading))
                    {
                        Debug.LogWarning("注意: 不是预期的调用:" + listRes1[i]);
                        ++m_nCurCount;
                        CheckFinished();
                    }
                }
            }
        }
Example #2
0
 //----------------------------------------------------------------------------
 public virtual void InitViewer(object arg, bool bflag = false)
 {
     m_paramData = arg;
     m_bIsShow   = bflag;
     if (viewer == null)
     {
         if (!m_bHasAddAtlas)
         {
             AddUseAtlas();
         }
         viewer         = Activator.CreateInstance(uiClass) as UIBase;
         viewer.strCtrl = strCtrl;
         viewer.impower = impower;
         viewer.RegisterViewMsg();
         viewer.SetCtrl(this);
         viewer.m_ctrl = this;
         PlugInMsgPipe(viewer);
         UnityEngine.Object obj = m_uiSystem.GetAssetBundle(strAssetID);
         if (obj != null)
         {
             m_Obj          = UnityEngine.Object.Instantiate(obj) as GameObject;
             viewer.strName = obj.name;
             viewer.SetObjUI(m_Obj);
             DeActiveForWait();
             viewer.SetSystem(m_uiSystem);
             viewer.LoadNeedRes(this);
         }
         else
         {
             if (!IsPreLoadView() && !LoadingUIManager.isInLoading && !("UICircleCtrl" == strCtrl))
             {
                 CheckLoadWaitStart();
             }
             m_uiSystem.LoadUIAsset(strAssetID, LoadFinishedEx);
         }
     }
 }