Advertisement
Guest User

Code ERROR CS0115

a guest
Jun 26th, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Photon.Pun;
  5. using Photon.Realtime;
  6.  
  7. public class PixelGunGameManager : MonoBehaviourPunCallbacks
  8. {
  9.  
  10.     [SerializeField]
  11.     GameObject playerPrefab;
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.     // Start is called before the first frame update
  19.     void Start()
  20.     {
  21.        
  22.         if (PhotonNetwork.IsConnected)
  23.         {
  24.             if (playerPrefab!=null)
  25.             {
  26.               int randomPoint = Random.Range(-20, 20);
  27.  
  28.               PhotonNetwork.Instantiate(playerPrefab.name, new Vector3(randomPoint,0,randomPoint),Quaternion.identity);
  29.             }
  30.          
  31.         }
  32.  
  33.     }
  34.  
  35.     // Update is called once per frame
  36.     void Update()
  37.     {
  38.        
  39.     }
  40.     public override void OnJoinedRoom()
  41.     {
  42.         Debug.Log(PhotonNetwork.NickName + " joined to " + PhotonNetwork.CurrentRoom.Name);
  43.  
  44.     }
  45.     public override void OnPlayerEnteredRoom(Player newPlayer)
  46.     {
  47.         Debug.Log(newPlayer.NickName + " joined to " + PhotonNetwork.CurrentRoom.Name + " " + PhotonNetwork.CurrentRoom.PlayerCount);
  48.     }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement