OpSetCustomPropertiesOfActor
How do I use Op Set Custom Properties Of Actor
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: LoadbalancingPeer.cs
Copy
282 public bool OpSetCustomPropertiesOfActor(int actorNr, Hashtable actorProperties, bool broadcast, byte channelId)
283 {
284 return this.OpSetPropertiesOfActor(actorNr, actorProperties.StripToStringKeys(), broadcast, channelId);
285 }
File name: PhotonPlayer.cs
Copy
184 public void SetCustomProperties(Hashtable propertiesToSet)
185 {
186 if (propertiesToSet == null)
187 {
188 return;
189 }
190
191 // merge (delete null-values)
192 this.customProperties.MergeStringKeys(propertiesToSet); // includes a Equals check (simplifying things)
193 this.customProperties.StripKeysWithNullValues();
194
195 // send (sync) these new values
196 Hashtable customProps = propertiesToSet.StripToStringKeys() as Hashtable;
197 if (this.actorID > 0 && !PhotonNetwork.offlineMode)
198 {
199 PhotonNetwork.networkingPeer.OpSetCustomPropertiesOfActor(this.actorID, customProps, true, 0);
200 }
201 NetworkingPeer.SendMonoMessage(PhotonNetworkingMessage.OnPhotonPlayerPropertiesChanged, this, propertiesToSet);
202 }
OpSetCustomPropertiesOfActor 142 lượt xem
Gõ tìm kiếm nhanh...