暂时修复单例第二次运行时出现的bug

This commit is contained in:
Wurui
2025-11-09 14:22:00 +08:00
parent 11e2ef00be
commit ed0c7f7547
3 changed files with 11 additions and 10 deletions

View File

@@ -6,6 +6,7 @@ namespace A2W
{
public class SceneSingleton<T> : MonoBehaviour where T : MonoBehaviour
{
[System.Obsolete]
public static T instance
{
get

View File

@@ -10,10 +10,10 @@ namespace A2W
{
get
{
if (applicationIsQuitting)
{
return null;
}
//if (applicationIsQuitting)
//{
// return null;
//}
if (_instance == null)
{
@@ -51,12 +51,12 @@ namespace A2W
}
}
private static bool applicationIsQuitting = false;
//private static bool applicationIsQuitting = false;
public void OnDestroy()
{
applicationIsQuitting = true;
}
//public void OnDestroy()
//{
// applicationIsQuitting = true;
//}
}
}