예제 #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);
                }
            }
        }
예제 #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!");
     }
 }
예제 #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);
        }
예제 #4
0
        public override void Init()
        {
            if (ConfigMgr.S.GlobalConfig.EditorModel)
            {
                m_curResLoader = new EditorResLoader();
            }
            else
            {
                //m_curResLoader = new RelaseResLoader();
            }

            DebugMgr.Log("资源管理器初始化完成");
        }
예제 #5
0
        public TObjofPool GetObj()
        {
            if (m_CacheObjList.Count > 0)
            {
                TObjofPool item = m_CacheObjList[0];
                m_CacheObjList.Remove(m_CacheObjList[0]);
                item.OnUse();
                DebugMgr.Log(string.Format("从对象池{0}的缓存中获取对象", m_name));
                return(item);
            }

            DebugMgr.Log(string.Format("在对象池{0}中创建对象", m_name));
            return(new TObjofPool());
        }
예제 #6
0
 public EditorResLoader()
 {
     m_LoadingRes = new List <ResInfo>();
     m_cacheRes   = new Dictionary <string, Object>();
     DebugMgr.Log("编辑模式加载器创建完成");
 }
예제 #7
0
 public override void Start()
 {
     DebugMgr.Log("资源管理器进入游戏");
 }
예제 #8
0
 public RelaseResLoader()
 {
     DebugMgr.Log("发布加载器创建完成");
 }