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:

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?

Comments

  • vadim
    Options
    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.