daily pastebin goal
14%
SHARE
TWEET

Untitled

a guest Apr 17th, 2013 304 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using UnityEngine;
  2.  
  3. public class RandomMatchmaker : Photon.MonoBehaviour
  4. {
  5.        
  6.     // Use this for initialization
  7.     void Start()
  8.     {
  9.         PhotonNetwork.ConnectUsingSettings("0.1");
  10.     }
  11.  
  12.     void OnGUI()
  13.     {
  14.         GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
  15.     }
  16.        
  17.         void OnJoinedLobby()
  18.         {
  19.             PhotonNetwork.JoinRandomRoom();
  20.         }
  21.        
  22.         void OnPhotonRandomJoinFailed()
  23.         {
  24.             PhotonNetwork.CreateRoom(null);
  25.         }
  26.        
  27.        
  28.         void OnJoinedRoom(){
  29.                 PhotonNetwork.Instantiate("Player", new Vector3(0.0f, 2.0f, 0.02f), Quaternion.identity, 0);
  30.         }
  31.        
  32. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top