ゲームが作れるようになるまでがんばる日記

ゲーム制作のことを中心にゲームに関することを書いています

サウンドの読み込み

サウンドをSmartSoundLoaderを使って読み込む方法はテクスチャの場合とあまり変わりは無い。
読み込むサウンドファイルを列挙した定義ファイルを用意し、smartSoundLoaderのLoadDefFileでSoundLoaderを作成する。使いたいサウンドはSoundLoaderのGetSoundで取得できる。

SmartSoundLoader smartSoundLoader;
SoundLoader soundLoader;

smartSoundLoader = new SmartSoundLoader();
soundLoader = smartSoundLoader.LoadDefFile("soundlist.txt");

soundLoader.GetSound(0).Play();