Created
September 26, 2022 13:45
-
-
Save martindevans/ffd22e45c5faeae320f780ba7d2ba206 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DissonanceMicPermission | |
: MonoBehaviour | |
{ | |
void OnEnable() | |
{ | |
StartCoroutine(RequestPermission()); | |
} | |
IEnumerator CheckPermission() | |
{ | |
yield return Application.RequestUserAuthorization(UserAuthorization.Microphone); | |
if (Application.HasUserAuthorization(UserAuthorization.Microphone)) | |
{ | |
Debug.Log("Microphone Permission Granted."); | |
FindObjectOfType<DissonanceComms>().ResetMicrophoneCapture(); | |
} | |
else | |
{ | |
Debug.Log("Microphone Permission Denied!"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment