SendCommandToChildrenOverChannel
Methods
public bool SendCommandToChildrenOverChannel<TTarget>(string methodName, MessageTarget target, Channel channel) where TTarget : class
Send a command over a specified channel to another client to call a method to every component in the hierarchy that has methodName bound.
Parameters
| Type | Name | Description |
|---|---|---|
| string | methodName | The name of the method to call. Tip: use C#'s nameof() operator to avoid name mismatches. |
| MessageTarget | target | To which clients should this command be sent. |
| Channel | channel | The channel over which the command is sent. |
Returns
| Type | Description |
|---|---|
| bool | true if the sending was successful. |
Type Parameters
| Name | Description |
|---|---|
| TTarget | The type of the Unity component that contains the method to call. |
public bool SendCommandToChildrenOverChannel(Type targetType, string methodName, MessageTarget target, Channel channel)
Send a command over a specified channel to another client to call a method to every component in the hierarchy that has methodName bound.
Parameters
| Type | Name | Description |
|---|---|---|
| Type | targetType | |
| string | methodName | The name of the method to call. Tip: use C#'s nameof() operator to avoid name mismatches. |
| MessageTarget | target | To which clients should this command be sent. |
| Channel | channel |
Returns
| Type | Description |
|---|---|
| bool | true if the sending was successful. |
public bool SendCommandToChildrenOverChannel<TTarget>(string methodName, MessageTarget target, Channel channel, params object[] args) where TTarget : class
Send a command over a specified channel to another client to call a method to every component in the hierarchy that has methodName bound.
Parameters
| Type | Name | Description |
|---|---|---|
| string | methodName | The name of the method to call. Tip: use C#'s nameof() operator to avoid name mismatches. |
| MessageTarget | target | To which clients should this command be sent. |
| Channel | channel | |
| object[] | args | The arguments to send to the method, make sure they match its signature. |
Returns
| Type | Description |
|---|---|
| bool | true if the sending was successful. |
Type Parameters
| Name | Description |
|---|---|
| TTarget | The type of the Unity component that contains the method to call. |
public bool SendCommandToChildrenOverChannel(Type targetType, string methodName, MessageTarget target, Channel channel, params object[] args)
Send a command over a specified channel to another client to call a method to every component in the hierarchy that has methodName bound.
Parameters
| Type | Name | Description |
|---|---|---|
| Type | targetType | |
| string | methodName | The name of the method to call. Tip: use C#'s nameof() operator to avoid name mismatches. |
| MessageTarget | target | To which clients should this command be sent. |
| Channel | channel | |
| object[] | args | The arguments to send to the method, make sure they match its signature. |
Returns
| Type | Description |
|---|---|
| bool | true if the sending was successful. |
public bool SendCommandToChildrenOverChannel<TTarget>(string methodName, MessageTarget target, Channel channel, params (Type, object)[] args) where TTarget : class
Send a command over a specified channel to another client to call a method to every component in the hierarchy that has methodName bound.
Parameters
| Type | Name | Description |
|---|---|---|
| string | methodName | The name of the method to call. Tip: use C#'s nameof() operator to avoid name mismatches. |
| MessageTarget | target | To which clients should this command be sent. |
| Channel | channel | |
| (Type, object)[] | args | The arguments to send to the method, make sure they match its signature. This version of SendCommand uses tuples with the type and the value of each argument, this enables sending of null values. |
Returns
| Type | Description |
|---|---|
| bool | true if the sending was successful. |
Type Parameters
| Name | Description |
|---|---|
| TTarget | The type of the Unity component that contains the method to call. |
public bool SendCommandToChildrenOverChannel(Type targetType, string methodName, MessageTarget target, Channel channel, params (Type, object)[] args)
Send a command over a specified channel to another client to call a method to every component in the hierarchy that has methodName bound.
Parameters
| Type | Name | Description |
|---|---|---|
| Type | targetType | |
| string | methodName | The name of the method to call. Tip: use C#'s nameof() operator to avoid name mismatches. |
| MessageTarget | target | To which clients should this command be sent. |
| Channel | channel | |
| (Type, object)[] | args | The arguments to send to the method, make sure they match its signature. This version of SendCommand uses tuples with the type and the value of each argument, this enables sending of null values. |
Returns
| Type | Description |
|---|---|
| bool | true if the sending was successful. |