using System.Collections; using System.Collections.Generic; using UnityEngine; public class DontDestroyMusic : MonoBehaviour { private void Awake() { GameObject[] musicObj = GameObject.FindGameObjectsWithTag("MusicFon"); if (musicObj.Length > 1) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); } }