SendOrderedCommandToChildren
Methods
public bool SendOrderedCommandToChildren<TTarget>(string methodName, MessageTarget target) where TTarget : Component
Send an ordered command to another client to call a method to every component in the hierarchy that has methodName bound. Command being ordered means that it will arrive on other clients in the same order relative to other sent ordered commands (and other ordered changes) from this client.
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. |
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 SendOrderedCommandToChildren(Type targetType, string methodName, MessageTarget target)
Send an ordered command to another client to call a method to every component in the hierarchy that has methodName bound. Command being ordered means that it will arrive on other clients in the same order relative to other sent ordered commands (and other ordered changes) from this client.
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. |
Returns
Type | Description |
---|---|
bool | true if the sending was successful. |
public bool SendOrderedCommandToChildren<TTarget>(string methodName, MessageTarget target, params object[] args) where TTarget : Component
Send an ordered command to another client to call a method to every component in the hierarchy that has methodName bound. Command being ordered means that it will arrive on other clients in the same order relative to other sent ordered commands (and other ordered changes) from this client.
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. |
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 SendOrderedCommandToChildren(Type targetType, string methodName, MessageTarget target, params object[] args)
Send an ordered command to another client to call a method to every component in the hierarchy that has methodName bound. Command being ordered means that it will arrive on other clients in the same order relative to other sent ordered commands (and other ordered changes) from this client.
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. |
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 SendOrderedCommandToChildren<TTarget>(string methodName, MessageTarget target, params (Type, object)[] args) where TTarget : Component
Send an ordered command to another client to call a method to every component in the hierarchy that has methodName bound. Command being ordered means that it will arrive on other clients in the same order relative to other sent ordered commands (and other ordered changes) from this client.
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. |
(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 SendOrderedCommandToChildren(Type targetType, string methodName, MessageTarget target, params (Type, object)[] args)
Send an ordered command to another client to call a method to every component in the hierarchy that has methodName bound. Command being ordered means that it will arrive on other clients in the same order relative to other sent ordered commands (and other ordered changes) from this client.
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. |
(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. |