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; return;
} }
GameObject player;
Transform startPos = GetStartPosition(); Transform startPos = GetStartPosition();
if (startPos != null) GameObject player = startPos != null
{ ? Instantiate(playerPrefab, startPos.position, startPos.rotation)
player = Instantiate(playerPrefab, startPos.position, startPos.rotation); : Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);
}
else
{
player = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity);
}
NetworkServer.AddPlayerForConnection(conn, player); NetworkServer.AddPlayerForConnection(conn, player);
} }