Skip to content

Commit 7c69ae6

Browse files
Erik Bylundkirre-bylund
authored andcommitted
Stop using deprecated find object method
1 parent 28ee2aa commit 7c69ae6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Runtime/Game/LootLockerServerManager.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,12 @@ public static void CheckInit()
2121
{
2222
if (i == null)
2323
{
24-
var existingObj = GameObject.FindObjectOfType<LootLockerServerManager>();
24+
var existingObj =
25+
#if UNITY_2021_3_OR_NEWER
26+
GameObject.FindAnyObjectByType<LootLockerServerManager>();
27+
#else
28+
GameObject.FindObjectOfType<LootLockerServerManager>();
29+
#endif
2530

2631
if (existingObj != null)
2732
{

0 commit comments

Comments
 (0)