Version: 2022.2
public bool forceToMono ;

描述

将音频剪辑强制设置为单声道?

using UnityEngine;
using UnityEditor;

public class Example : AssetPostprocessor { void OnPreprocessAudio() { AudioImporter audioImporter = assetImporter as AudioImporter; if (assetPath.Contains("mono")) { audioImporter = assetImporter as AudioImporter; audioImporter.forceToMono = true; } } }