Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. using UnityEngine;
  2. using Photon.Pun;
  3. using Photon.Realtime;
  4.  
  5. public class LoginManager : MonoBehaviourPunCallbacks {
  6.  
  7.  
  8. public GameObject m_player;
  9. public Vector3 m_playerInitPosition;
  10. public Vector3 m_playerInitRotation;
  11.  
  12. private void Start() {
  13. Login();
  14. }
  15.  
  16. public void Login() {
  17. PhotonNetwork.GameVersion = "1.0";
  18. PhotonNetwork.ConnectUsingSettings();
  19. }
  20.  
  21. public override void OnConnectedToMaster() {
  22. PhotonNetwork.JoinOrCreateRoom("MainRoom", new RoomOptions(), TypedLobby.Default);
  23. }
  24.  
  25. public override void OnJoinedRoom() {
  26. PhotonNetwork.Instantiate(m_player.name, m_playerInitPosition, Quaternion.Euler(m_playerInitRotation));
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement