Skip to content

Instantly share code, notes, and snippets.

@yasuakiohama
Created June 7, 2015 16:35
Show Gist options
  • Save yasuakiohama/b5e42947afaae92f28ea to your computer and use it in GitHub Desktop.
Save yasuakiohama/b5e42947afaae92f28ea to your computer and use it in GitHub Desktop.
CustomImporter.cs
using UnityEngine;
using UnityEditor;
public sealed class CustomImporter : AssetPostprocessor
{
public override int GetPostprocessOrder()
{
return 0;
}
void OnPreprocessAudio()
{
//大文字小文字対応
//ここ入れた文字がパスにあるフォルダのデータは3Dサウンドのチェックが外れる
if (assetPath.Contains("Voice"))
{
AudioImporter audioImporter = assetImporter as AudioImporter;
//audioImporter.format = AudioImporterFormat.Compressed;
audioImporter.threeD = false; //2d sound
//audioImporter.compressionBitrate = 96000; //96kbps
}
//BGM
else if (assetPath.Contains("BGM"))
{
AudioImporter audioImporter = assetImporter as AudioImporter;
// audioImporter.format = AudioImporterFormat.Compressed;
audioImporter.threeD = false; //2d sound
//ストリーミング再生
// audioImporter.loadType = AudioClipLoadType.Streaming;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment