summaryrefslogtreecommitdiff
path: root/Thronefall_v1.0/Decompile/PriorityAudioListener.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Thronefall_v1.0/Decompile/PriorityAudioListener.cs')
-rw-r--r--Thronefall_v1.0/Decompile/PriorityAudioListener.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/Thronefall_v1.0/Decompile/PriorityAudioListener.cs b/Thronefall_v1.0/Decompile/PriorityAudioListener.cs
new file mode 100644
index 0000000..127e5fb
--- /dev/null
+++ b/Thronefall_v1.0/Decompile/PriorityAudioListener.cs
@@ -0,0 +1,27 @@
+using System.Collections;
+using UnityEngine;
+
+public class PriorityAudioListener : MonoBehaviour
+{
+ private void OnEnable()
+ {
+ StartCoroutine(ExecuteAfterTime());
+ }
+
+ private IEnumerator ExecuteAfterTime()
+ {
+ while (BackupAudioListener.Instance == null)
+ {
+ yield return null;
+ }
+ BackupAudioListener.Instance.EnableBackupListener(enable: false);
+ }
+
+ private void OnDisable()
+ {
+ if (BackupAudioListener.Instance != null)
+ {
+ BackupAudioListener.Instance.EnableBackupListener(enable: true);
+ }
+ }
+}