Skip to content

Commit 9eba000

Browse files
committed
Improve use faster code
1 parent fcabe72 commit 9eba000

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Assets/Scripts/ObjectSpawnerCommands.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ private ObjectSpawnController ObjectSpawnController
2525
{
2626
if (_objectSpawnController == null)
2727
{
28+
#if UNITY_2023_2_OR_NEWER
29+
_objectSpawnController = Object.FindFirstObjectByType<ObjectSpawnController>();
30+
#else
2831
_objectSpawnController = Object.FindObjectOfType<ObjectSpawnController>();
32+
#endif
2933
}
3034

3135
return _objectSpawnController;

0 commit comments

Comments
 (0)