BlueGit

blue-star ggj-2020

Files

ggj-2020 / Assets / SFXSpawner.cs

SFXSpawner.cs

Jam end
timfa Tim Falken · pushed by timfa · 6 years ago
f9387e84 History
SFXSpawner.cs 595 B Download Raw
1using System.Collections;
2using System.Collections.Generic;
3using UnityEngine;
4
5public class SFXSpawner : MonoBehaviour
6{
7 private static SFXSpawner instance;
8 [SerializeField] private SFXInstance sfxPrefab;
9
10 // Start is called before the first frame update
11 void Awake()
12 {
13 instance = this;
14 }
15
16 public static void StartSFX(Sounds sound, Vector3 position)
17 {
18 SFXInstance sfx = Instantiate(instance.sfxPrefab, position, Quaternion.identity);
19 sfx.PlayAudio(sound);
20 }
21
22 public enum Sounds
23 {
24 Connect, Disconnect, Click
25 }
26}