Constructor NetworkObjectReference
NetworkObjectReference(NetworkObject)
Creates a new instance of the NetworkObjectReference struct.
Declaration
public NetworkObjectReference(NetworkObject networkObject)
Parameters
| Type | Name | Description |
|---|---|---|
| NetworkObject | networkObject | The NetworkObject to reference. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | |
| ArgumentException |
NetworkObjectReference(GameObject)
Creates a new instance of the NetworkObjectReference struct.
Declaration
public NetworkObjectReference(GameObject gameObject)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | gameObject | The GameObject from which the NetworkObject component will be referenced. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | |
| ArgumentException |