public void Start() { networkingStatus = NetworkingStatus.Offline; #if hNW_PHOTON PhotonStarter punStarter = GetComponent <PhotonStarter>(); if (punStarter == null) { punStarter = gameObject.AddComponent <PhotonStarter>(); //punStarter.hideFlags = HideFlags.HideInInspector; } punStarter.StartNetworking(roomName, gameVersion, networkingPrefab, sendRate); #elif hNW_UNET UnetStarter unetStarter = GetComponent <UnetStarter>(); if (unetStarter == null) { unetStarter = gameObject.AddComponent <UnetStarter>(); unetStarter.hideFlags = HideFlags.HideInInspector; } if (serverType == ServerType.CloudServer) { unetStarter.StartNetworking(this.gameObject, roomName, gameVersion); } else { if (role == Role.Host) { unetStarter.StartNetworking(this.gameObject, "127.0.0.1"); } else { unetStarter.StartNetworking(this.gameObject, serverIpAddress); } } #endif }
public override bool Setup() { this.photonProcess = PhotonStarter.Start( this.MasterServerAddress, MasterServerAppName, this.Protocol, "/debug LoadBalancing /config PhotonServer.LoadBalancing-Development.config"); return(true); }