public MutliplayerObject AddPlayer(string playername, Vector3 playerPosition) { // Funktion wird genutzt um neue Spieler hinzuzufügen MutliplayerObject newObject = ScriptableObject.CreateInstance <MutliplayerObject>(); newObject.Init(playerPrefab, playerPosition, this.gameObject, playername); players.Add(idCounter, newObject); idCounter++; Debug.Log("MultiplayerSystem: Added new Player: " + playername + " Position: " + playerPosition); return(newObject); }
public void AddPlayer() { MutliplayerObject newObject = ScriptableObject.CreateInstance <MutliplayerObject>(); newObject.Init(playerPrefab, player.transform.position, this.gameObject, "PlayerName"); players.Add(idCounter, newObject); idCounter++; //newBlock.GetComponent<MeshRenderer>().material = tempBlock.blockMaterial; Debug.Log("MultiplayerSystem: Adding my own Player"); //take some variables like the position and instaciate a playerPrefab into the multiplayerWOrlds object }