Когда игрок входит на сервер работает следуйшый код, когда входит первый игрок все нормально, когда входит второй спавнится* 3 player(Clone);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using Photon.Pun;
using Photon.Realtime;
using System.IO;
public class gameManag : MonoBehaviourPunCallbacks
{
// public Text chat;
public GameObject PlayerPf;
public GameObject CameraPf;
public Managmant NAME;
private PhotonView play;
private Vector3[] spawn = new []{new Vector3(0f,19f,65f),new Vector3(80f,19f,65f),new Vector3(80f,-24f,65f),new Vector3(0f,-24f,65f)};
private void Start()
{
PhotonNetwork.Instantiate(Path.Combine("PhotonPrefabs","player"),spawn[UnityEngine.Random.Range(0,3)],Quaternion.identity);
// GameObject.Find("player(Clone)").name = PhotonNetwork.NickName;
// PhotonNetwork.Instantiate(Path.Combine("PhotonPrefabs","Cam"),new Vector3(GameObject.Find(PhotonNetwork.NickName).transform.position.x,GameObject.Find(PhotonNetwork.NickName).transform.position.y,-30f),Quaternion.identity);
// GameObject.Find("Cam(Clone)").name = PhotonNetwork.NickName+"cam";
}
public override void OnPlayerEnteredRoom(Player newPl)
{
// PhotonNetwork.Instantiate(Path.Combine("PhotonPrefabs","player"),spawn[Random.Range(0,3)],Quaternion.identity);
// GameObject.Find("player(Clone)").name = PhotonNetwork.NickName;
// PhotonNetwork.Instantiate(Path.Combine("PhotonPrefabs","Cam"),new Vector3(GameObject.Find(PhotonNetwork.NickName).transform.position.x,GameObject.Find(PhotonNetwork.NickName).transform.position.y,-30f),Quaternion.identity);
// GameObject.Find("Cam(Clone)").name = PhotonNetwork.NickName+"cam";
}
}