Пример #1
0
    public IEnumerator OnLoadAllAsset(string assetBundleName, string assetName, Action <UnityEngine.Object[]> fn)
    {
        AssetBundleLoadAssetOperation request = AssetBundleManager.LoadAssetAsync(assetBundleName, assetName, typeof(UnityEngine.Object), false);

        if (request == null)
        {
            yield break;
        }
        yield return(StartCoroutine(request));

        UnityEngine.Object[] obj = request.GetAllAsset <UnityEngine.Object>();
        //Debug.Log(assetName + (obj == null ? " isn't" : " is") + " loaded successfully at frame " + Time.frameCount);
        if (fn != null)
        {
            fn(obj);
        }
    }