using System.Collections; using System.Collections.Generic; using UnityEngine; public class DontDestroyOnLoadGameplayController : MonoBehaviour { private void Awake() { if (GameplayController.GetInstance().DontDestroyOnLoadGameplayController) { DontDestroyOnLoad(this.gameObject); GameplayController.GetInstance().DontDestroyOnLoadGameplayController = false; } else { Destroy(gameObject); } } }