Skip to content

Instantly share code, notes, and snippets.

@haydenjameslee
Created May 25, 2015 04:41
Show Gist options
  • Save haydenjameslee/b549213497fa6cf702d2 to your computer and use it in GitHub Desktop.
Save haydenjameslee/b549213497fa6cf702d2 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class NetworkController : MonoBehaviour
{
string _room = "Tutorial_Convrge";
void Start()
{
PhotonNetwork.ConnectUsingSettings("0.1");
}
void OnJoinedLobby()
{
Debug.Log("joined lobby");
RoomOptions roomOptions = new RoomOptions() { };
PhotonNetwork.JoinOrCreateRoom(_room, roomOptions, TypedLobby.Default);
}
void OnJoinedRoom()
{
PhotonNetwork.Instantiate("NetworkedPlayer", Vector3.zero, Quaternion.identity, 0);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment