コード例 #1
0
    public void SpawnPlayers()
    {
        // Iterate through the number of players and assign their spawn points
        for (int x = 0; x < currentPlayers; x++)
        {
            if (x < spawnPoints.Length)
            {
                GameObject go = Instantiate(playerPrefab, spawnPoints[x].position, Quaternion.identity);
                MultiplayerThirdPersonControl player = go.GetComponent <MultiplayerThirdPersonControl>();

                player.SetPlayerID(playerIDs[x]);
                player.SetLayerMask(layerMasks[x]);
                player.SetDeadState(false);
            }
        }
    }
コード例 #2
0
 public void KillPlayer(MultiplayerThirdPersonControl player)
 {
     player.SetDeadState(true);
     currentPlayers -= 1;
 }