Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

SetCustomPropesties Queue

$
0
0
Hello

Only one user can be custom properties color blue?
SetCustomProperties => it takes a little time to be active in all users
To prevent simultaneous operation
Can you give an example or solution


Problem Example. How can you be in a queue?
Alex and Vika Joined Room.
Alex and Vika at the same time Button Click



public void ButtonClick(){
ChangeColor();
}


-----------
public void ChangeColor(){

if(ColorAvailable){
Hashtable HC = new Hashtable ();
HC.Add ("color", "blue");
PhotonNetwork.player.SetCustomProperties (HC);
}

}
---------------
public bool ColorAvailable(){

foreach (PhotonPlayer player in PhotonNetwork.playerList) {
string c = (string)player.customProperties ["color"];

if (c == "blue") {
return false;
}

}

return true;
}
---------------------------------


Help


Viewing all articles
Browse latest Browse all 15755

Trending Articles