What is being returned when calling PhotonView.isMine ?

Options
I'm in the process of learning about RPC and according to the tutorial I'm following all that it takes to call an RPC method is the following code
 void Update()
 {
 if( !PhotonView.isMine )
 return;
 if ( Input.GetKeyDown( KeyCode.Space ) )
 PhotonView.RPC( "testRPC", RPCMode.All );
 }
 [RPC]
 void testRPC( NetworkMessageInfo info )
 {
 Debug.Log( "Test RPC called from " + info.sender.ipAddress );
 }
does PhotonView.isMine return an array of all photonViews in the scene and thus the if statement is used? can I instead us PhotonView.getViewId for example to target a specfic view?
also in the same code if I was to remove the ! not from the if statment i.e
if( PhotonView.isMine )
would it call the method when the other player presses the spacebar?

Comments

  • Tobias
    Options
    The script with Update() is on a GameObject with a specific PhotonView. All views on the GO are either true or false for isMine. It's not a list (if doesn't work with lists, only bool).
    To target a specific GO, you need to have a reference to it. How that's done is probably explained somewhere, but it's less a Photon question (sorry).
  • SuperRaed
    Options
    thanks Tobias, it's not what I was asking for perhaps I should have rephrased better.
    say for example Player 1 instantiated a GO what would happen is a GO is created in his scene and a projection or a clone is created in the other Player's scene, right? and the same thing goes for player 2 as well I assume.
    now my question is, within player 1 GO script when I say if(photonView.isMine) then obviously I'm referring to my object but when I say if ( ! photonView.isMine) who am I referring to? is it my projection in the other player's scene or the other player's projection in my scene?