NetworkingPeer.SetReceivingEnabled C# (CSharp) Method

SetReceivingEnabled() public method

public SetReceivingEnabled ( int group, bool enabled ) : void
group int
enabled bool
return void
    public void SetReceivingEnabled(int group, bool enabled)
    {
        if (group <= 0)
        {
            Debug.LogError("Error: PhotonNetwork.SetReceivingEnabled was called with an illegal group number: " + group + ". The group number should be at least 1.");
            return;
        }

        if (enabled)
        {
            if (!this.allowedReceivingGroups.Contains(group))
            {
                this.allowedReceivingGroups.Add(group);
                byte[] groups = new byte[1] { (byte)group };
                this.OpChangeGroups(null, groups);
            }
        }
        else
        {
            if (this.allowedReceivingGroups.Contains(group))
            {
                this.allowedReceivingGroups.Remove(group);
                byte[] groups = new byte[1] { (byte)group };
                this.OpChangeGroups(groups, null);
            }
        }
    }

Same methods

NetworkingPeer::SetReceivingEnabled ( int enableGroups, int disableGroups ) : void

Usage Example

Exemplo n.º 1
0
 public static void SetReceivingEnabled(int group, bool enabled)
 {
     if (VerifyCanUseNetwork())
     {
         networkingPeer.SetReceivingEnabled(group, enabled);
     }
 }
All Usage Examples Of NetworkingPeer::SetReceivingEnabled
NetworkingPeer