Example #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);
            }
        }
Example #2
0
 public AssetsLoad(string assetBundleName)
 {
     if (EditorAssetLoad.LocalLoadModel)
     {
         editorAssetLoad = EditorAssetLoad.Take(assetBundleName);
     }
     else
     {
         assetBundleLoad = AssetBundleLoad.Take(assetBundleName);
     }
 }
Example #3
0
        public static void Put(EditorAssetLoad editorAssetLoad)
        {
            if (editorAssetLoad.referenceCount == 1)
            {
                editorAssetLoad.referenceCount = 0;

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