示例#1
0
        public IRes GetRes(string ownerBundleName, string assetName, bool createNew = false)
        {
            IRes res;

            if (mResDictionary.TryGetValue((ownerBundleName + assetName).ToLower(), out res))
            {
                return(res);
            }

            if (!createNew)
            {
                return(null);
            }

            res = ResFactory.Create(assetName, ownerBundleName);

            if (res != null)
            {
                mResDictionary.Add((ownerBundleName + assetName).ToLower(), res);
                if (!mResList.Contains(res))
                {
                    mResList.Add(res);
                }
            }
            return(res);
        }
示例#2
0
        public IRes GetRes(string assetName, bool createNew = false)
        {
            IRes res = null;

            if (mResDictionary.TryGetValue(assetName, out res))
            {
                return(res);
            }

            if (!createNew)
            {
                Log.I("createNew:{0}", createNew);
                return(null);
            }

            res = ResFactory.Create(assetName);

            if (res != null)
            {
                mResDictionary.Add(assetName, res);
                mResList.Add(res);
                if (!mResList.Contains(res))
                {
                    mResList.Add(res);
                }
            }
            return(res);
        }
示例#3
0
        public IRes GetRes(ResSearchRule resSearchRule, bool createNew = false)
        {
            IRes res = null;

            if (mResDictionary.TryGetValue(resSearchRule.DictionaryKey, out res))
            {
                return(res);
            }

            if (!createNew)
            {
                QFramework.Log.I("createNew:{0}", createNew);
                return(null);
            }

            res = ResFactory.Create(resSearchRule);

            if (res != null)
            {
                mResDictionary.Add(resSearchRule.DictionaryKey, res);
                if (!mResList.Contains(res))
                {
                    mResList.Add(res);
                }
            }
            return(res);
        }
示例#4
0
        private Res CreateRes(string assetName, string ownerBundle = null)
        {
            var res = ResFactory.Create(assetName, ownerBundle);

            ResMgr.Instance.SharedLoadedReses.Add(res);

            AddRes2Record(res);

            return(res);
        }
示例#5
0
        public IRes GetRes(string name, bool createNew = false)
        {
            IRes res = null;

            if (m_ResDictionary.TryGetValue(name, out res))
            {
                return(res);
            }

            if (!createNew)
            {
                return(null);
            }

            res = ResFactory.Create(name);

            if (res != null)
            {
                m_ResDictionary.Add(name, res);
                m_ResList.Add(res);
            }
            return(res);
        }
示例#6
0
        public IRes GetRes(ResSearchKeys resSearchKeys, bool createNew = false)
        {
            var res = mTable.GetResBySearchKeys(resSearchKeys);

            if (res != null)
            {
                return(res);
            }

            if (!createNew)
            {
                Log.I("createNew:{0}", createNew);
                return(null);
            }

            res = ResFactory.Create(resSearchKeys);

            if (res != null)
            {
                mTable.Add(res);
            }

            return(res);
        }