Ejemplo n.º 1
0
        //不包含路径的预设体名,
        public UObj GetResource(string PrefabName)
        {
            UObj obj = null;

            string ABname = ResourceSetting.ConvertToAssetBundleName(PrefabName);

            if (dicAsset.TryGetValue(ABname, out obj) == false)
            {
                if (dicLoadingReq.ContainsKey(ABname))
                {
                    ConsoleEx.DebugLog("<GetResource Failed> Res is still loading, res.Name = " + ABname);
                }
                else
                {
                    // ConsoleEx.DebugLog("<GetResource Failed> Res not exist, res.Name = " + ABname);
                }
                obj = null;
            }
            else
            {
                // 添加引用
                RefAsset(ABname);
            }
            return(obj);
        }
Ejemplo n.º 2
0
        public WWW GetLoadingWWW(string pbName)
        {
            string AssetBundleName = ResourceSetting.ConvertToAssetBundleName(pbName);
            WWW    www             = null;

            dicLoadingReq.TryGetValue(AssetBundleName, out www);
            return(www);
        }
Ejemplo n.º 3
0
        public bool IsResLoaded(string pbName)
        {
            string AssetBundleName = ResourceSetting.ConvertToAssetBundleName(pbName);

            return(dicAsset.ContainsKey(AssetBundleName));
        }