Files
HauntedBloodlines/Assets/Scripts/SaveLoad/DontDestroyOnLoadGameplayController.cs
2025-05-29 22:31:40 +03:00

20 lines
493 B
C#

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);
}
}
}