EVERYTHING
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using Photon.Pun;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Photon.VR.Player
|
||||
{
|
||||
public class PlayerSpawner : MonoBehaviourPunCallbacks
|
||||
{
|
||||
[Tooltip("The location of the player prefab")]
|
||||
public string PrefabLocation = "PhotonVR/Player";
|
||||
|
||||
private GameObject playerTemp;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
Object.DontDestroyOnLoad(base.gameObject);
|
||||
}
|
||||
|
||||
public override void OnJoinedRoom()
|
||||
{
|
||||
playerTemp = PhotonNetwork.Instantiate(PrefabLocation, Vector3.zero, Quaternion.identity, 0);
|
||||
}
|
||||
|
||||
public override void OnLeftRoom()
|
||||
{
|
||||
PhotonNetwork.Destroy(playerTemp);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user