コード例 #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;
 }