初始化

This commit is contained in:
2025-12-11 16:40:24 +08:00
commit f8947c6c27
149 changed files with 18871 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DontDestroyMgr : Singleton<DontDestroyMgr>
{
List<GameObject> dontDesObj = new List<GameObject>();
public void DontDesOnLoad(GameObject obj)
{
if(!dontDesObj.Contains(obj))
{
Object.DontDestroyOnLoad(obj);
dontDesObj.Add(obj);
}
}
public void Clear()
{
foreach(GameObject obj in dontDesObj)
{
Object.DestroyImmediate(obj);
}
dontDesObj.Clear();
}
}