AssetPostprocessor.OnPreprocessAudio 在导入音频之前

function OnPreprocessAudio () : void

Description描述

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

在子类中加入这个函数,以便在一个声音剪辑载入之前获得一个通知。

This lets you control the import settings trough code.

它让你控制导入选项

class MyAudioPostprocessor extends AssetPostprocessor {
	function OnPreprocessAudio () {
		// Import files containin "mono" in their name as mono.
		//导入文件名包含mono的文件
		if (assetPath.Contains("mono")) {
			var audioImporter : AudioImporter = assetImporter;
			audioImporter.forceToMono = true;
		}
	}
}
Page last updated: 2011-1-8