Method TryGet
TryGet(out NetworkBehaviour, NetworkManager)
Tries to get the NetworkBehaviour referenced by this reference.
Declaration
public bool TryGet(out NetworkBehaviour networkBehaviour, NetworkManager networkManager = null)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkBehaviour | networkBehaviour | The NetworkBehaviour which was found. Null if the corresponding NetworkObject was not found. |
| NetworkManager | networkManager | The networkmanager. Uses Singleton to resolve if null. |
Returns
| Type | Description |
|---|---|
| bool | True if the NetworkBehaviour was found; False if the NetworkBehaviour was not found. This can happen if the corresponding NetworkObject has not been spawned yet. you can try getting the reference at a later point in time. |
TryGet<T>(out T, NetworkManager)
Tries to get the NetworkBehaviour referenced by this reference.
Declaration
public bool TryGet<T>(out T networkBehaviour, NetworkManager networkManager = null) where T : NetworkBehaviour
Parameters
| Type | Name | Description |
|---|---|---|
| T | networkBehaviour | The NetworkBehaviour which was found. Null if the corresponding NetworkObject was not found. |
| NetworkManager | networkManager | The networkmanager. Uses Singleton to resolve if null. |
Returns
| Type | Description |
|---|---|
| bool | True if the NetworkBehaviour was found; False if the NetworkBehaviour was not found. This can happen if the corresponding NetworkObject has not been spawned yet. you can try getting the reference at a later point in time. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the networkBehaviour for convenience. |