blob: 276c37202a99a7448aebf97877f702c63799334c (
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
|
using UnityEngine;
public class BackupAudioListener : MonoBehaviour
{
public static BackupAudioListener Instance { get; private set; }
private void Awake()
{
if (Instance == null)
{
Instance = this;
Object.DontDestroyOnLoad(base.gameObject);
}
else
{
Object.Destroy(base.gameObject);
}
}
public void EnableBackupListener(bool enable)
{
GetComponent<AudioListener>().enabled = enable;
}
}
|