Hello everyone.
I'm doing some tutorials, all simple for now. But, when creating the room and on the same pc log me in, no one can see changes in the scene.
Why?
I'm doing some tutorials, all simple for now. But, when creating the room and on the same pc log me in, no one can see changes in the scene.
Why?
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NetworkManager : Photon.MonoBehaviour {
public GameObject gameManager;
void Start()
{
gameManager = GameObject.Find("GameManager");
PhotonNetwork.ConnectUsingSettings("1.0"); //Conectar ao Servidor Photon
}
//Interacao
void OnGUI()
{
GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString()); //Retorna o estado da coneccao
if (GUILayout.Button("Create Room"))
{
PhotonNetwork.CreateRoom("Teste");
//gameManager.GetComponent<GameManager>().Player[0] = 1;
}
if (GUILayout.Button("Joint Room"))
{
PhotonNetwork.JoinRoom("Teste");
/* Random
//Tries to join any random game:
PhotonNetwork.JoinRandomRoom();
//Error callback: OnPhotonRandomJoinFailed
*/
//gameManager.GetComponent<GameManager>().Player[1] = 2;
}
}
void OnJoinedRoom()
{
//PhotonNetwork.LoadLevel("ScenePedro");
PhotonNetwork.Instantiate("PlayerCamera",
transform.position, transform.rotation, 0);
}
}