spawn bots at same position

This commit is contained in:
vis2k 2023-01-26 23:55:52 +09:00
parent 3510361d08
commit 3cd0c847a1

View File

@ -178,15 +178,15 @@ public override void OnServerAddPlayer(NetworkConnectionToClient conn)
{ {
TestNTNetworkAuthenticator.AuthRequestMessage authData = (TestNTNetworkAuthenticator.AuthRequestMessage)conn.authenticationData; TestNTNetworkAuthenticator.AuthRequestMessage authData = (TestNTNetworkAuthenticator.AuthRequestMessage)conn.authenticationData;
Vector3 spawnPos = new Vector3(Random.Range(-20, 20), 5, Random.Range(-20, 20)); //Vector3 spawnPos = new Vector3(Random.Range(-20, 20), 5, Random.Range(-20, 20));
GameObject player; GameObject player;
if (authData.isBot) if (authData.isBot)
player = Instantiate(spawnPrefabs[1], spawnPos, Quaternion.identity); player = Instantiate(spawnPrefabs[1]);
else else
player = Instantiate(playerPrefab, spawnPos, Quaternion.identity); player = Instantiate(playerPrefab);
player.transform.LookAt(new Vector3(0f, 5f, 0f)); player.transform.LookAt(new Vector3(0f, 2f, 0f));
PlayerName playerName = player.GetComponent<PlayerName>(); PlayerName playerName = player.GetComponent<PlayerName>();
if (authData.isBot) if (authData.isBot)