Legacy Documentation: Version 4.5.0

Script language:

  • JS
  • C#
  • Boo
Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

var threeD: bool;
bool threeD;
threeD as bool

Description

Is this clip a 2D or 3D sound?

	// C#: Prints a warning if the imported audio is a 2D sound.
	class Warning2D extends AssetPostprocessor {
		function OnPreprocessAudio () {
			var audioImporter : AudioImporter = assetImporter;
			if(!audioImporter.threeD)
				Debug.LogWarning(assetPath + " is not a 3D audio.");
		}
	}