22 lines
417 B
C#
22 lines
417 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class BackgroundMusic : MonoBehaviour
|
|
{
|
|
private static BackgroundMusic backgroundMusic;
|
|
|
|
void Awake()
|
|
{
|
|
if(backgroundMusic == null)
|
|
{
|
|
backgroundMusic = this;
|
|
DontDestroyOnLoad(backgroundMusic);
|
|
}
|
|
else
|
|
{
|
|
Destroy(gameObject);
|
|
}
|
|
}
|
|
}
|