Make sure PhotonView viewID is not 0 in sites

This commit is contained in:
Pascal Serrarens 2022-02-25 14:55:52 +01:00
parent 228b5925b7
commit 9034590707

View File

@ -111,6 +111,8 @@ namespace Passer {
Photon.Pun.PhotonView photonView = gameObject.GetComponent<Photon.Pun.PhotonView>(); Photon.Pun.PhotonView photonView = gameObject.GetComponent<Photon.Pun.PhotonView>();
if (photonView == null) if (photonView == null)
photonView = gameObject.AddComponent<Photon.Pun.PhotonView>(); photonView = gameObject.AddComponent<Photon.Pun.PhotonView>();
if (photonView.ViewID == 0)
Photon.Pun.PhotonNetwork.AllocateViewID(photonView);
Photon.Pun.PhotonTransformView transformView = gameObject.GetComponent<Photon.Pun.PhotonTransformView>(); Photon.Pun.PhotonTransformView transformView = gameObject.GetComponent<Photon.Pun.PhotonTransformView>();
if (transformView == null) { if (transformView == null) {