๐Ÿ“ฆ james7132 / Infection

๐Ÿ“„ BackgroundMusic.cs ยท 31 lines
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
31using UnityEngine;
using System.Collections;

public class BackgroundMusic : MonoBehaviour {
	
	public static BackgroundMusic instance;
	
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void Awake()
	{
		if(instance != null && instance != this)
		{
				Destroy (gameObject);
		}
		else
		{
				instance = this;
		}
		DontDestroyOnLoad(gameObject);
	}
}