mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
优化TSingleton和TEngine使用体验
优化TSingleton和TEngine使用体验
This commit is contained in:
@@ -28,7 +28,16 @@ namespace TEngine
|
||||
{
|
||||
if (_root == null)
|
||||
{
|
||||
_root = GameObject.Find("TEngine");
|
||||
_root = GameObject.Find("TEngineMgr");
|
||||
|
||||
if (_root == null)
|
||||
{
|
||||
_root = new GameObject("TEngineMgr");
|
||||
|
||||
_root.transform.position = Vector3.zero;
|
||||
}
|
||||
|
||||
UnityEngine.Object.DontDestroyOnLoad(_root);
|
||||
}
|
||||
|
||||
return _root;
|
||||
|
@@ -22,7 +22,7 @@ namespace TEngine
|
||||
GameObject go = SingletonMgr.GetGameObject(instName);
|
||||
if (go == null)
|
||||
{
|
||||
go = GameObject.Find($"/{instName}");
|
||||
go = GameObject.Find($"{instName}");
|
||||
if (go == null)
|
||||
{
|
||||
go = new GameObject(instName);
|
||||
|
Reference in New Issue
Block a user