Update TSingleton.cs

This commit is contained in:
ALEXTANG
2023-05-20 11:25:44 +08:00
parent 344f3293ad
commit 2369e8723c

View File

@@ -42,7 +42,7 @@ namespace GameBase
} }
}; };
} }
UnityEngine.Object.DontDestroyOnLoad(_root); Object.DontDestroyOnLoad(_root);
} }
return _root; return _root;
} }
@@ -70,7 +70,7 @@ namespace GameBase
_gameObjects.Add(go.name, go); _gameObjects.Add(go.name, go);
if (Application.isPlaying) if (Application.isPlaying)
{ {
UnityEngine.Object.DontDestroyOnLoad(go); Object.DontDestroyOnLoad(go);
} }
} }
} }
@@ -80,7 +80,7 @@ namespace GameBase
if (_gameObjects != null && _gameObjects.ContainsKey(go.name)) if (_gameObjects != null && _gameObjects.ContainsKey(go.name))
{ {
_gameObjects.Remove(go.name); _gameObjects.Remove(go.name);
UnityEngine.Object.Destroy(go); Object.Destroy(go);
} }
} }