NetworkManager - only ?: (#207)

This commit is contained in:
MichalPetryka 2019-01-02 17:19:02 +01:00 committed by Paul Pacheco
parent 2ad3aca857
commit 7ec94c79b1

View File

@ -648,16 +648,10 @@ void OnServerAddPlayerInternal(NetworkConnection conn)
return;
}
GameObject player;
Transform startPos = GetStartPosition();
if (startPos != null)
{
player = Instantiate(playerPrefab, startPos.position, startPos.rotation);
}
else
{
player = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);
}
GameObject player = startPos != null
? Instantiate(playerPrefab, startPos.position, startPos.rotation)
: Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);
NetworkServer.AddPlayerForConnection(conn, player);
}