7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

アセットバンドル LoadAssetのTypeとファイル拡張子対応 メモ

Last updated at Posted at 2015-07-28

ファイルとTypeの対応がいまいっちょわからんのでメモ

●アセットバンドルのロード方法

■Unityエディター上

 AssetDatabase.LoadAssetAtPath(アセットのパス *Assets以下のパス, ロードする型)

■実機上

 AssetBundleCreateRequest assetBundleCreateRequest =
            AssetBundle.CreateFromMemory(バイトデータ);
  
  yield assetBundleCreateRequestでバンドル生成完了を待つ

 AssetBundle assetBundle = assetBundleCreateRequest.assetBundle;
 assetBundle.LoadAsset(AssetList[0],BundleType);

●ファイルと型の対応表(マークダウンで表にしたいなあ・・)

拡張子         LoadAssetの型
*.prefab        GameObject
*.mat          Material
*.png          Texture2D(3Dもあるからケースバイケース??)
*.asset         Mesh(ケースバイケース??)
*.shader        Shader
*.fbx          GameObject
*.controller      RuntimeAnimatorController
*.tga          Texture2D
*.tif          Texture2D
*.anim         AnimationClip
*.mp3          AudioClip(AudioSourceをシーンに追加しましょう)
*.wav          AudioClip(AudioSourceをシーンに追加しましょう)

下記、コガネブログさんにもあったのでメモ
http://baba-s.hatenablog.com/entry/2015/08/13/100000

【Unity】各拡張子におけるアセットタイプ一覧
Unity Unity5 Unity5.1
拡張子 アセットタイプ
anim AnimationClip
wav AudioClip
mp3 AudioClip
ogg AudioClip
aif AudioClip
aiff AudioClip
xm AudioClip
mod AudioClip
it AudioClip
s3m AudioClip
hdr Cubemap
cubemap Cubemap
ttf Font
otf Font
dfont Font
prefab GameObject
mat Material
material Material
fbx Mesh
obj Mesh
max Mesh
blend Mesh
mov MovieTexture
mpg MovieTexture
mpeg MovieTexture
mp4 MovieTexture
avi MovieTexture
asf MovieTexture
physicmaterial PhysicMaterial
shader Shader
txt TextAsset
html TextAsset
htm TextAsset
xml TextAsset
bytes TextAsset
json TextAsset
csv TextAsset
yaml TextAsset
fnt TextAsset
exr Texture
psd Texture2D
tif Texture2D
tiff Texture2D
jpg Texture2D
tga Texture2D
png Texture2D
gif Texture2D
bmp Texture2D
iff Texture2D
pict Texture2D

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?