0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

obsoleteになったpreloadAudioDataの裏技?的解消法

Posted at

はじめに

Unityをいじってて、こんなエラーが出ました。

preloadAudioData がobsoleteなのでなんかいいのに変えてくれ

エラー内容についてはこちらを見てください。
→ https://docs.unity3d.com/6000.0/Documentation/ScriptReference/AudioImporter-preloadAudioData.html

つまり、preloadAudioDataはobsolete(サポートしてない)から、イーノック「一番いいのを頼む」ということですね。

preloadAudioDataはobsolete(サポートしてない)とき対処法は2択がありまして、

1. csファイルのpreloadAudioDataをすべてAudioImporter.preloadAudioDataに直す
2.  今回紹介する方法

です。
1についてはそのままなので省略しますが、

2. については一言でいうと

using AudioImporter;

というコードを序盤に追加するだけです。(今回の場合)
usingディレクティブ、最強ですね(笑)

結論

preloadAudioDataがobsoleteの時の裏技的対処法は

using AudioImporter;

を序盤に追加するだけ!
これ一行で本エラーは解消できました!

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?