I have some basic understanding about networkview and RPC call. Correct me if i am wrong as i am still quite confused how it is really work.
Player1 collect diamond1 in the scene. So i have already networkview to all the diamonds in the scene. So i am thinking if i should put reliable or unreliable or off for the state synchronisation. I have set my player to have reliable state synchronisation. So i suspect that i might need to use reliable state synchronisation for the diamond too.
if(hit.gameObject.tag == "greenDiamond")
{
Destroy(hit.gameObject);
AudioSource.PlayClipAtPoint(hitSound, transform.position);
// play a sound clip at the exact position we hit the object
collectgreenDiamond = collectgreenDiamond + 1;
networkView.RPC("update", RPCMode.AllBuffered, diamondID);
}
@RPC
function Update(diamondID : int, info: NetworkMessageInfo)
for(var i =0; i < diamond.length i++)
if(diamondID == diamond*)*
Destroy(gameObject);
Not tested yet, just my algorithm on how i want to do. One thing that stop me to continue writing is that, how do we know that the id of the diamond they collected??