Skip to content

Instantly share code, notes, and snippets.

@benblo
Last active May 6, 2023 10:43
Show Gist options
  • Save benblo/d8b31eab90195208cc38 to your computer and use it in GitHub Desktop.
Save benblo/d8b31eab90195208cc38 to your computer and use it in GitHub Desktop.
Disable AudioManager from build script
var audioManager = AssetDatabase.LoadAllAssetsAtPath("ProjectSettings/AudioManager.asset")[0];
var serializedManager = new SerializedObject(audioManager);
var prop = serializedManager.FindProperty("m_DisableAudio");
prop.boolValue = true;
serializedManager.ApplyModifiedProperties();
@Wilson403
Copy link

only editor?

@benblo
Copy link
Author

benblo commented Jun 30, 2022

only editor?

Yes, it's meant to be done during a build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment