Hello my script was working before but now when i go back to where the script is the background (bg) audio does not stop playing (its starts a new song while the other one is still playing) before it deleted the dontdestroyonload but now it does not do that anymore. can you help me pls
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class BgSound : MonoBehaviour
{
// Use this for initialization
void Start()
{
}
//Play Global
private static BgSound instance = null;
public static BgSound Instance
{
get { return instance; }
}
void Awake()
{
if (instance != null && instance != this)
{
Destroy(this.gameObject);
return;
}
else
{
instance = this;
}
DontDestroyOnLoad(this.gameObject);
}
//Play Gobal End
// Update is called once per frame
void Update()
{
}
}