Пример #1
0
        // アセット管理マニュフェスト情報を更新.
        private void SetAssetInfoManifest(AssetInfoManifest manifest)
        {
            assetInfoManifest = manifest;

            if (manifest == null)
            {
                Debug.LogError("AssetInfoManifest not found.");
                return;
            }

            var allAssetInfos = manifest.GetAssetInfos().ToArray();

            // アセット情報 (Key: アセットバンドル名).
            assetInfosByAssetBundleName = allAssetInfos
                                          .Where(x => x.IsAssetBundle)
                                          .ToLookup(x => x.AssetBundle.AssetBundleName);

            // アセット情報 (Key: リソースパス).
            assetInfosByResourcePath = allAssetInfos
                                       .Where(x => !string.IsNullOrEmpty(x.ResourcePath))
                                       .ToDictionary(x => x.ResourcePath);

            // アセットバンドル依存関係.
            var dependencies = allAssetInfos
                               .Where(x => x.IsAssetBundle)
                               .Select(x => x.AssetBundle)
                               .Where(x => x.Dependencies != null && x.Dependencies.Any())
                               .GroupBy(x => x.AssetBundleName)
                               .Select(x => x.FirstOrDefault())
                               .ToDictionary(x => x.AssetBundleName, x => x.Dependencies);

            assetBundleManager.SetDependencies(dependencies);
        }
Пример #2
0
 /// <summary>
 /// アセット管理情報を取得.
 /// </summary>
 /// <param name="groupName"></param>
 /// <returns></returns>
 public IEnumerable <AssetInfo> GetGroupAssetInfos(string groupName = null)
 {
     return(assetInfoManifest.GetAssetInfos(groupName));
 }