Version: 5.6

AssetPostprocessor.OnPreprocessAudio()

切换到手册

描述

Add this function in a subclass to get a notification just before an audio clip is being imported.

借助此函数,您可以通过代码控制导入设置。

    class MyAudioPostprocessor extends AssetPostprocessor {
    function OnPreprocessAudio () {
        // Import files containin "mono" in their name as mono.
        if (assetPath.Contains("mono")) {
            var audioImporter : AudioImporter = assetImporter;
            audioImporter.forceToMono = true;
        }
    }
}