示例#1
0
    public void SpawnPlayer(int _id, string _username, Vector3 _position, Quaternion _rotation)
    {
        GameObject _player;

        _position.x = 10.56F;
        _position.z = -1;
        if (_id == client.instance.myId)
        {
            _position.y = 6;
            _player     = Instantiate(localPlayerPrefab, _position, _rotation);
        }
        else
        {
            _position.y = 7;
            _player     = Instantiate(playerPrefab, _position, _rotation);
        }
        _player.GetComponent <PlayerManager>().id       = _id;
        _player.GetComponent <PlayerManager>().username = _username;
        players.Add(_id, _player.GetComponent <PlayerManager>());
        ui.setPanelToServer(false);
    }