Esempio n. 1
0
    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);
    }
Esempio n. 2
0
    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
    }