Erro de script de lobby photon.
Página 1 de 1
Erro de script de lobby photon.
esses sao os erros:
Assets/the game/Beta Game/game13/SCRIPTS/ConnectAndCreate.cs(29,34): error CS1503: Argument `#2' cannot convert `bool' expression to type `RoomOptions'
Assets/the game/Beta Game/game13/SCRIPTS/ConnectAndCreate.cs(29,17): error CS1502: The best overloaded method match for `PhotonNetwork.CreateRoom(string, RoomOptions, TypedLobby, string[])' has some invalid arguments
Script:
Assets/the game/Beta Game/game13/SCRIPTS/ConnectAndCreate.cs(29,34): error CS1503: Argument `#2' cannot convert `bool' expression to type `RoomOptions'
Assets/the game/Beta Game/game13/SCRIPTS/ConnectAndCreate.cs(29,17): error CS1502: The best overloaded method match for `PhotonNetwork.CreateRoom(string, RoomOptions, TypedLobby, string[])' has some invalid arguments
Script:
- Código:
using UnityEngine;
using System.Collections;
public class ConnectAndCreate : Photon.PunBehaviour
{
const string VERSION = "0.1";
// Connect to network
void Start ()
{
// connect to Phonton Network
PhotonNetwork.ConnectUsingSettings(VERSION);
// turn Scene Sync on
PhotonNetwork.automaticallySyncScene = true;
}
public void OnGUI()
{
// Debug info on connection status. Remove Later.
GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
}
// try join a random room.
public override void OnJoinedLobby()
{
PhotonNetwork.JoinRandomRoom();
}
// when failed to join random room create new room max players 3.
void OnPhotonRandomJoinFailed()
{
Debug.Log("No rooms available, creating new one.");
// (room name, not sure, not sure, max players). set room name to null for random name( to have more than 1 room created.
PhotonNetwork.CreateRoom(null, true, true, 3);
}
// when joined to a room check if max players are reached then send ROOM CREATOR into game.
public override void OnJoinedRoom()
{
if (PhotonNetwork.playerList.Length == 3) {
Debug.Log ("3 Players In Room Starting Level");
PhotonNetwork.LoadLevel ("Level01");
}
else if (PhotonNetwork.playerList.Length == 2) {
Debug.Log ("2 Players Waiting In Room");
}
else if (PhotonNetwork.playerList.Length == 1) {
Debug.Log ("1 Player Waiting In Room");
}
}
// when joined to a room check if max players are reached then send EVERY PLAYER into game(problem it does not send room creator).
void OnPhotonPlayerConnected(PhotonPlayer newPlayer){
if (PhotonNetwork.playerList.Length == 3) {
Debug.Log ("3 Players In Room Starting Level");
PhotonNetwork.LoadLevel ("Level01");
}
else if (PhotonNetwork.playerList.Length == 2) {
Debug.Log ("2 Players Waiting In Room");
}
else if (PhotonNetwork.playerList.Length == 1) {
Debug.Log ("1 Player Waiting In Room");
}
}
}
PatifeCraft- Avançado
- PONTOS : 2886
REPUTAÇÃO : 6
Respeito as regras :
Tópicos semelhantes
» Erro em script do Photon Voice
» Erro Script Photon
» Erro Script Photon
» erro no Photon
» Erro em script para photon
» Erro Script Photon
» Erro Script Photon
» erro no Photon
» Erro em script para photon
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos