Skip to content

Instantly share code, notes, and snippets.

@TakaakiIchijo
Last active January 8, 2024 02:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakaakiIchijo/6d2f8573ac92e877a621e5aa679c7a18 to your computer and use it in GitHub Desktop.
Save TakaakiIchijo/6d2f8573ac92e877a621e5aa679c7a18 to your computer and use it in GitHub Desktop.
Enable the mute button on Game View when uses CRI ADX in Unity
using CriWare;
using UnityEditor;
[InitializeOnLoadAttribute]
public class CriWareGameViewMuteButton
{
private static bool isAudioMute = false;
static CriWareGameViewMuteButton()
{
EditorApplication.update += () =>
{
if (isAudioMute == EditorUtility.audioMasterMute) return;
isAudioMute = EditorUtility.audioMasterMute;
CriAtomExAsr.SetBusVolume(0, isAudioMute ? 0f : 1f);
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment