Ejemplo n.º 1
0
 public void LoadAssetAsyncByAssetBundleName <T>(AssetAllLoaderRequest request) where T : Object
 {
     if (UseAssetBundle)
     {
         _resource_load.LoadAssetAsyncByName <T>(request);
     }
 }
Ejemplo n.º 2
0
    IEnumerator loadAssets(List <string> assetNames)
    {
        for (int i = 0; i < assetNames.Count; i++)
        {
            yield return(new WaitForSeconds(0.5F));

            AssetAllLoaderRequest request = new AssetAllLoaderRequest(assetNames[i]);
            request.OnLoaderCompleted = onLoadAsset;
            Managers.Resources.LoadAssetAsyncByAssetBundleName <Object>(request);
        }
    }
Ejemplo n.º 3
0
    public void AsyncLoadAllAssets <T>(AssetAllLoaderRequest asset) where T : Object
    {
        if (_bundle == null)
        {
            return;
        }
        AssetBundleRequest request = _bundle.LoadAllAssetsAsync <T>();

        request.completed += (rt) =>
        {
            asset.Completed(request.allAssets);
        };
    }
Ejemplo n.º 4
0
    public void LoadAssetAsyncByName <T>(AssetAllLoaderRequest request) where T : Object
    {
        AssetBundleInfo abInfo = null;

        if (_asset_bundles.TryGetValue(request.AssetBundleName, out abInfo))
        {
            if (abInfo.IsLoader)
            {
                abInfo.AsyncLoadAllAssets <T>(request);
            }
            else
            {
                AssetBundleLoaderRequest abRequest =
                    AssetBundleLoaderRequest.New(request.AssetBundleName);
                abRequest.OnCompleted += (rt) =>
                {
                    abInfo.AsyncLoadAllAssets <T>(request);
                };
                InternalLoadAssetBundleAsync(abInfo, abRequest);
            }
        }
    }