mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
Update TSingleton.cs
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user