summaryrefslogtreecommitdiff
path: root/Thronefall_v1.0/Decompile/PriorityAudioListener.cs
blob: 127e5fba4b5791131588d02d1b8de5851be81bde (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
		}
	}
}