C#:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using Photon.Realtime;
public class server : MonoBehaviourPunCallbacks
{
// Start is called before the first frame update
void Start()
{
PhotonNetwork.ConnectUsingSettings();
}
public override void OnConnectedToMaster()
{
base.OnConnectedToMaster();
Debug.Log("connected server");
PhotonNetwork.JoinLobby();
}
public override void OnJoinedLobby()
{
base.OnJoinedLobby();
Debug.Log("connect lobby");
PhotonNetwork.JoinRandomOrCreateRoom("oda", new RoomOptions { MaxPlayers=2, IsOpen=true, IsVisible=true }, TypedLobby.Default);
}
void Update()
{
}
}