示例#1
0
        public static EditorAssetLoad Take(string assetBundleName)
        {
            EditorAssetLoad editorAssetLoad;

            if (allEditorAssetLoad.TryGetValue(assetBundleName, out editorAssetLoad) == false)
            {
                //todo 验证是ab包名正确性

                editorAssetLoad = new EditorAssetLoad();
                allEditorAssetLoad.Add(assetBundleName, editorAssetLoad);

                editorAssetLoad.referenceCount  = 0;
                editorAssetLoad.assetBundleName = assetBundleName;
                editorAssetLoad.assetRootPath   = new string[] { assetBundleName.Replace('_', '/') };
                editorAssetLoad.allAsset        = new Dictionary <string, Object>();

                editorAssetLoad.referenceCount++;
                return(editorAssetLoad);
            }
            else
            {
                editorAssetLoad.referenceCount++;
                return(editorAssetLoad);
            }
        }
示例#2
0
 public AssetsLoad(string assetBundleName)
 {
     if (EditorAssetLoad.LocalLoadModel)
     {
         editorAssetLoad = EditorAssetLoad.Take(assetBundleName);
     }
     else
     {
         assetBundleLoad = AssetBundleLoad.Take(assetBundleName);
     }
 }
示例#3
0
        public static void Put(EditorAssetLoad editorAssetLoad)
        {
            if (editorAssetLoad.referenceCount == 1)
            {
                editorAssetLoad.referenceCount = 0;

                editorAssetLoad.allAsset.Clear();
            }
            else
            {
                editorAssetLoad.referenceCount--;
            }
        }
示例#4
0
 public void UnLoad()
 {
     if (EditorAssetLoad.LocalLoadModel)
     {
         EditorAssetLoad.Put(editorAssetLoad);
         editorAssetLoad = null;
     }
     else
     {
         AssetBundleLoad.Put(assetBundleLoad);
         assetBundleLoad = null;
     }
 }