GetBindingValue
method in Coherence.Toolkit.SpawnInfo
Methods
public T GetBindingValue<T>(string bindingName)
Returns the initial data that will be applied to a network instantiated entity's bindings. This method is intended to query pre-synced data during Instantiate(SpawnInfo). It can be useful when it is necessary to know a field's value ahead of time, e.g., to identify the proper pool or asset to use when instantiating a remote entity. If multiple matches exist for the given binding name and type, the first binding in the Bindings list is returned.
Parameters
| Type | Name | Description |
|---|---|---|
| string | bindingName | The name of the binding, e.g. "position" |
Returns
| Type | Description |
|---|---|
| T | Returns the initial synced value for a given binding. |
Type Parameters
| Name | Description |
|---|---|
| T | The binding's value type, e.g. "Vector3" |
Exceptions
| Type | Condition |
|---|---|
| Exception | If the binding does not exist, or isn't synced with the initial packet, an exception is thrown. |