Skip to content

Commit

Permalink
Fixed prefab instatiation with Configurable Enter Play Mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Nezz authored and Mathijs-Bakker committed Feb 16, 2022
1 parent e8af9a1 commit 7ba9fcf
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ public static IEnumerable<GameObject> GetRootGameObjects(Scene scene)
// without any of their Awake() methods firing.
public static Transform GetOrCreateInactivePrefabParent()
{
if(_disabledIndestructibleGameObject == null || (!Application.isPlaying && _disabledIndestructibleGameObject.scene != SceneManager.GetActiveScene()))
if(_disabledIndestructibleGameObject == null ||
(!Application.isPlaying && _disabledIndestructibleGameObject.scene != SceneManager.GetActiveScene()) ||
!_disabledIndestructibleGameObject.scene.isLoaded)
{
var go = new GameObject("ZenUtilInternal_PrefabParent");
go.hideFlags = HideFlags.HideAndDontSave;
Expand Down

0 comments on commit 7ba9fcf

Please sign in to comment.