17 lines
371 B
C#
17 lines
371 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class DoNotDestroy : MonoBehaviour
|
|
{
|
|
void Awake()
|
|
{
|
|
GameObject[] musicObj = GameObject.FindGameObjectsWithTag("GameMusic");
|
|
if( musicObj.Length > 1)
|
|
{
|
|
Destroy(this.gameObject);
|
|
}
|
|
DontDestroyOnLoad(this.gameObject);
|
|
}
|
|
}
|