Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ static void InstantiateAndInitialize()
ProfileBlock.UnityMainThread = Thread.CurrentThread;
#endif

#if UNITY_6000
Assert.That(FindObjectsByType<ProjectContext>(FindObjectsSortMode.None).IsEmpty(),
"Tried to create multiple instances of ProjectContext!");
#else
Assert.That(FindObjectsOfType<ProjectContext>().IsEmpty(),
"Tried to create multiple instances of ProjectContext!");

#endif
var prefab = TryGetPrefab();

var prefabWasActive = false;
Expand Down
5 changes: 5 additions & 0 deletions UnityProject/Assets/Plugins/Zenject/Source/Util/UnityUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ public static IEnumerable<GameObject> GetDirectChildren(GameObject obj)

public static IEnumerable<GameObject> GetAllGameObjects()
{
#if UNITY_6000
return Object.FindObjectsByType<Transform>(FindObjectsSortMode.None)
.Select(x => x.gameObject);
#else
return GameObject.FindObjectsOfType<Transform>().Select(x => x.gameObject);
#endif
}

public static List<GameObject> GetAllRootGameObjects()
Expand Down