Skip to content

Commit

Permalink
fix: Avoid FindObjectOfType when not needed (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lymdun committed Mar 4, 2020
1 parent b2c3ffb commit e2a4afd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Assets/Mirror/Runtime/NetworkStartPosition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public class NetworkStartPosition : MonoBehaviour

public void Awake()
{
manager = FindObjectOfType<NetworkManager>();
if (manager == null)
manager = FindObjectOfType<NetworkManager>();

manager.RegisterStartPosition(transform);
}

Expand Down

0 comments on commit e2a4afd

Please sign in to comment.