アラキタウン

黒歴史や生き恥を切り売り

AssetBundleに含まれたテキストファイルを取得する。

AssetBundleに"test.txt"を含め、テキスト情報だけ取得したかったのですが、
以下でできました。

 

AssetBundleCreateRequest acr = AssetBundle.LoadFromFileAsync("AssetBundleのパス");
TextAsset text = acr.assetBundle.LoadAsset<TextAsset>("test.txt");

 

以下の書き方でも取得できる。

TextAsset text = acr.assetBundle.LoadAsset("test.txt", typeof(TextAsset)) as TextAsset;