public SetCustomProperties ( Hashtable propertiesToSet ) : void | ||
propertiesToSet | Hashtable | Hashtable of props to udpate, set and sync. See description. |
리턴 | void |
public void SetCustomProperties(Hashtable propertiesToSet)
{
if (propertiesToSet == null)
{
return;
}
// merge (delete null-values)
this.customProperties.MergeStringKeys(propertiesToSet); // includes a Equals check (simplifying things)
this.customProperties.StripKeysWithNullValues();
// send (sync) these new values
Hashtable customProps = propertiesToSet.StripToStringKeys() as Hashtable;
PhotonNetwork.networkingPeer.OpSetCustomPropertiesOfActor(this.actorID, customProps, true, 0);
NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnPhotonPlayerPropertiesChanged, this);
}
// sets and syncs custom properties on a network player (including masterClient) private void SetCustomProperties(PhotonPlayer player, int car, int position) { ExitGames.Client.Photon.Hashtable customProperties = new ExitGames.Client.Photon.Hashtable() { { "spawn", position }, {"car", car} }; player.SetCustomProperties(customProperties); }