How can I pass the refrence of a object with photonview.rpc
Options
I am using photon for unity, I am trying to create a method that can take in my RPC's and change the arguments values so I can create Generic content:
How can I pass boolTochange so the original reference (foobar) will change on both client and server?
UpdateButton(foobar);
void UpdateButton(ref bool boolTochange)
{
if (!photonView.isMine)
{
return;
}
photonView.RPC("ChangeButton",
PhotonTargets.AllViaServer,
boolTochange);
}
[PunRPC]
void ChangeButton(ref bool booToChange)
{
boolToChange = !booToChange;
}
How can I pass boolTochange so the original reference (foobar) will change on both client and server?
0
Comments
-
You can't do this. It does not make sense because RPC method executed on every client in room. So it's unclear what client should update you reference.0