Photon Cloud : Trigger Serialize View

Options
Hi, when I move an object, Serialize view gets called everywhere.
Is there a way I can trigger this when a certain property is modified?

Let's say I have a card, and is on a deck.
When is drawn, it must show for everyone, si I set card.ShoudShow = true;

I want in this point, to call the serialize view, so if I'm the master client, I can call every other view to update and start showing the card.
thx!

Comments

  • photonview has a method, executeSerialize... lol. Does this have any documentation ? Or I can just create a new stream and that's it?
  • Tobias
    Options
    PhotonView.ExecuteSerialize is not a public API, so we skipped docs for it. It's not the level you want to use PUN with.
    Use OnPhotonSerializeView() in an observed script (as described in the Marco Polo Tutorial: http://doc.exitgames.com/photon-cloud/M ... o_Tutorial). This method will be called 10 times per second (by default) and you can either pass info to the stream or skip that (and the update in turn, too).

    If your game is more event driven (input or timers or whatever), you can also use RPCs instead.
    In your case, I'd create an internal state in all clients. Then define the RPCs as interface to modify the state. Make sanity checks if the RPC you get makes sense and is allowed (good error messages are useful for debugging). Each player's turns will modify all states in the same way, so it doesn't matter who is active or drops or whatever.