time to bed
This commit is contained in:
@@ -2,8 +2,17 @@ using UnityEngine;
|
||||
|
||||
public class DontDestroy : MonoBehaviour
|
||||
{
|
||||
public static DontDestroy Instance { get; private set; }
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
DontDestroyOnLoad(gameObject);
|
||||
if (Instance == null)
|
||||
{
|
||||
Instance = this;
|
||||
DontDestroyOnLoad(gameObject);
|
||||
}
|
||||
else
|
||||
Destroy(gameObject);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user