// Start is called before the first frame update void Start() { //Singleton code { if (instance == null) { instance = this; } else { Destroy(this.gameObject); } } //Setup Room options roomOptions.MaxPlayers = maxPlayers; PhotonNetwork.GameVersion = gameVersion; if (!PhotonNetwork.IsConnected) { PhotonNetwork.ConnectUsingSettings(); } action += Connect; DontDestroyOnLoad(this.gameObject); }
private void Awake() { launcher = GameObject.Find("Server").GetComponent <PUNLauncher>(); launcher.menu = this; }