-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSoundManager.cs
More file actions
67 lines (53 loc) · 1.24 KB
/
SoundManager.cs
File metadata and controls
67 lines (53 loc) · 1.24 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FMODUnity;
using FMOD.Studio;
public class SoundManager : MonoBehaviour
{
private static SoundManager instance;
public static SoundManager Instance
{
get
{
if (instance == null)
{
GameObject soundManagerObject = new GameObject("SoundManager");
instance = soundManagerObject.AddComponent<SoundManager>();
}
return instance;
}
}
private void Awake()
{
if (instance == null)
{
instance = this;
DontDestroyOnLoad(gameObject);
}
else
{
Destroy(gameObject);
}
}
public void TowerTurn()
{
RuntimeManager.PlayOneShot("event:/Tower");
}
public void TowerTurnComplete()
{
RuntimeManager.PlayOneShot("event:/TurnComplete");
}
public void TowerFell()
{
RuntimeManager.PlayOneShot("event:/TowerFell");
}
public void PuzzleBlock()
{
RuntimeManager.PlayOneShot("event:/PuzzleBlock");
}
public void PlayLevelWon()
{
RuntimeManager.PlayOneShot("event:/LevelWon");
}
}