SetSendingEnabled
How do I use Set Sending Enabled
Below are practical examples compiled from projects for learning and reference purposes
Featured Snippets
File name: NetworkingPeer.cs
Copy
3083 public void SetSendingEnabled(int group, bool enabled)
3084 {
3085 if (!enabled)
3086 {
3087 this.blockSendingGroups.Add(group); // can be added to HashSet no matter if already in it
3088 }
3089 else
3090 {
3091 this.blockSendingGroups.Remove(group);
3092 }
3093 }
File name: NetworkingPeer.cs
Copy
3096 public void SetSendingEnabled(int[] enableGroups, int[] disableGroups)
3097 {
3098 if(enableGroups!=null){
3099 foreach(int i in enableGroups){
3100 if(this.blockSendingGroups.Contains(i))
3101 this.blockSendingGroups.Remove(i);
3102 }
3103 }
3104 if(disableGroups!=null){
3105 foreach(int i in disableGroups){
3106 if(!this.blockSendingGroups.Contains(i))
3107 this.blockSendingGroups.Add(i);
3108 }
3109 }
3110 }
File name: PhotonNetwork.cs
Copy
2564 /// Enable/disable sending on given group (applied to PhotonViews)
2568 public static void SetSendingEnabled(int group, bool enabled)
2569 {
2570 if (!VerifyCanUseNetwork())
2571 {
2572 return;
2573 }
2574
2575 networkingPeer.SetSendingEnabled(group, enabled);
2576 }
File name: PhotonNetwork.cs
Copy
2580 /// Enable/disable sending on given groups (applied to PhotonViews)
2584 public static void SetSendingEnabled(int[] enableGroups, int[] disableGroups)
2585 {
2586 if (!VerifyCanUseNetwork())
2587 {
2588 return;
2589 }
2590 networkingPeer.SetSendingEnabled(enableGroups, disableGroups);
2591 }
SetSendingEnabled 151 lượt xem
Gõ tìm kiếm nhanh...