forked from bbbscarter/UberAudio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAudioBankMounter.cs
More file actions
executable file
·44 lines (39 loc) · 1.12 KB
/
AudioBankMounter.cs
File metadata and controls
executable file
·44 lines (39 loc) · 1.12 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
namespace UberAudio
{
[AddComponentMenu("Assets/Uber Audio/Bank Mounter")]
public class AudioBankMounter : MonoBehaviour
{
public List<string> BanksToMount = new List<string>();
private bool loaded = false;
void Start()
{
if (AudioManager.Instance == null)
{
Debug.LogWarning("There is no UberAudio Manager found");
return;
}
foreach (var bankName in BanksToMount)
{
AudioManager.Instance.LoadEventBank(bankName);
loaded = true;
}
}
void OnDestroy()
{
if (AudioManager.Instance == null)
{
return;
}
foreach (var bankName in BanksToMount)
{
if (AudioManager.Instance != null && loaded)
{
AudioManager.Instance.UnloadEventBank(bankName);
}
}
}
}
}