I want to spawn a RawImage over the network.
I´ve added this script to a prefab to be spawned:
[RequireComponent(typeof(PhotonView))]
public class exchange_frame : MonoBehaviour {
[SerializeField]
public RawImage rawImage;
void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
if (stream.isWriting)
{
stream.SendNext(rawImage);
}
else
{
rawImage = (RawImage)stream.ReceiveNext();
}
}
}
But I received the following: Exception: cannot serialize(): UnityEngine.UI.RawImage
Should I convert to byte[] ? Or what else?
I´ve added this script to a prefab to be spawned:
[RequireComponent(typeof(PhotonView))]
public class exchange_frame : MonoBehaviour {
[SerializeField]
public RawImage rawImage;
void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
if (stream.isWriting)
{
stream.SendNext(rawImage);
}
else
{
rawImage = (RawImage)stream.ReceiveNext();
}
}
}
But I received the following: Exception: cannot serialize(): UnityEngine.UI.RawImage
Should I convert to byte[] ? Or what else?