Exemple #1
0
    public void Start()
    {
        GameManager = this;
        allplayer   = PhotonNetwork.PlayerList;
        foreach (var p in allplayer)
        {
            if (p != PhotonNetwork.LocalPlayer)
            {
                ID++;
            }
        }

        _spawn = _spawnPlayer.spawnPosition(ID).position;
        var player = PhotonNetwork.Instantiate(PlayerPrefs.GetString("Path"), _spawn, Quaternion.identity);

        listPlayer.Add(player);
        player.name    = "Player_" + PhotonNetwork.NickName;
        _camera.Follow = player.transform;
        _camera.LookAt = player.transform;

        if (PhotonNetwork.IsMasterClient)
        {
            _startGame.SetActive(true);
        }
        if (Advertisement.isSupported)
        {
            Advertisement.Initialize("4011935", false);
        }
    }