Advertisement
Guest User

Untitled

a guest
Apr 17th, 2013
394
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  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. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement