예제 #1
0
    // 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);
    }
예제 #2
0
 private void Awake()
 {
     launcher      = GameObject.Find("Server").GetComponent <PUNLauncher>();
     launcher.menu = this;
 }