Esempio n. 1
0
        public void Update()
        {
            if (m_LoadingRes.Count > 0)
            {
                m_curResInfo = m_LoadingRes[0];

                Object asset;
                if (m_cacheRes.TryGetValue(m_curResInfo.name, out asset))
                {
                    //do nothing;
                }
                else
                {
                    asset = AssetDatabase.LoadAssetAtPath(m_curResInfo.name, m_curResInfo.type);
                    m_cacheRes.Add(m_curResInfo.name, asset);
                }

                if (asset != null)
                {
                    m_curResInfo.cb(true, asset);
                    m_LoadingRes.Remove(m_curResInfo);
                }
                else
                {
                    DebugMgr.LogError("加载资源失败:" + m_curResInfo.name);
                }
            }
        }
Esempio n. 2
0
 public override void Init()
 {
     m_globalConfig = AssetDatabase.LoadAssetAtPath <GlobalConfig>("Assets/XFramework/GameMgr/ConfigMgr/GlobalConfig.asset");
     if (m_globalConfig == null)
     {
         DebugMgr.LogError("GlobalConfig is invalid!");
     }
 }
Esempio n. 3
0
        public static UIData GetUIData(UIID uiId)
        {
            UIData thisUIData;

            if (UIDataTableDic.TryGetValue(uiId, out thisUIData))
            {
                return(thisUIData);
            }

            DebugMgr.LogError(uiId.ToString() + "Don't init!");
            return(null);
        }