public void OnSpawnPlayer(SpawnPlayerData spawnPlayerData) { Debug.Log("Got Player Spawn Data!"); var player = _spawner.GetPlayerObject(spawnPlayerData); AddNewNetObject(player, spawnPlayerData.objectID); _playerList.Add(spawnPlayerData.owner, player); SendMessageToObjectWaitOneFrame(spawnPlayerData, spawnPlayerData.objectID, GetFunctionName(spawnPlayerData)); }
public GameObject GetPlayerObject(SpawnPlayerData playerData) { var player = baseSpawn(Player, playerData); var netOBJ = player.GetComponent <NetworkObject>(); if (netOBJ != null) { netOBJ.SetIsOwner(playerData.IsOwner); } return(player); }
public void PlayerSpawn(SpawnPlayerData spawnPlayerData) { this.speed = spawnPlayerData.speed; var tempHealthComp = GetComponent <HealthComponent>(); healthComponent.Health = spawnPlayerData.Health; healthComponent.MaxHealth = spawnPlayerData.MaxHealth; if (!_netObject.getIsOwner()) { GetComponentInChildren <Camera>().enabled = false; } }
public void OnSpawnPlayer(SpawnPlayerData spawnPlayerData) { }