Class SpeckleUnityClient
Base class for all SpeckleUnity client types. Inherit from this class to define your own client types.
Namespace: SpeckleUnity
Assembly: cs.temp.dll.dll
Syntax
public abstract class SpeckleUnityClient
Fields
client
A reference to the internal client object that this object registers with.
Declaration
public SpeckleApiClient client
Field Value
| Type | Description |
|---|---|
| SpeckleApiClient |
manager
A reference to the manager instance which oversees the functions of this client. Allows for
access to the fields made available in its inspector as well as the StartCoroutine ()
method.
Declaration
protected SpeckleUnityManager manager
Field Value
| Type | Description |
|---|---|
| SpeckleUnityManager |
streamID
The ID of the stream for this object to be a client of.
Declaration
public string streamID
Field Value
| Type | Description |
|---|---|
| System.String |
Methods
ClientOnError(Object, SpeckleEventArgs)
Base implementation of the "OnError" event response. It just logs an error and is intended to be overriden.
Declaration
protected virtual void ClientOnError(object source, SpeckleEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | Source object passed from the event. |
| SpeckleEventArgs | e | Arguments passed from the event. |
ClientOnLogData(Object, SpeckleEventArgs)
Base implementation of the "OnLogData" event response. It's empty at this level and intended to be overriden.
Declaration
protected virtual void ClientOnLogData(object source, SpeckleEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | Source object passed from the event. |
| SpeckleEventArgs | e | Arguments passed from the event. |
ClientOnReady(Object, SpeckleEventArgs)
Base implementation of the "OnReady" event response. It's empty at this level and intended to be overriden.
Declaration
protected virtual void ClientOnReady(object source, SpeckleEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | Source object passed from the event. |
| SpeckleEventArgs | e | Arguments passed from the event. |
ClientOnWsMessage(Object, SpeckleEventArgs)
Base implementation of the "OnWsMessage" event response. It's empty at this level and intended to be overriden.
Declaration
protected virtual void ClientOnWsMessage(object source, SpeckleEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | source | Source object passed from the event. |
| SpeckleEventArgs | e | Arguments passed from the event. |
InitializeClient(SpeckleUnityManager, String, String)
All clients need to be initialized which creates an instance of an internal speckle client object, authenticates against the server and provides a manager object to receive inspector arguments from.
Declaration
public abstract Task InitializeClient(SpeckleUnityManager manager, string url, string authToken)
Parameters
| Type | Name | Description |
|---|---|---|
| SpeckleUnityManager | manager | The manager instance that provides inspector values for this client. |
| System.String | url | The url of the speckle server to connect to. |
| System.String | authToken | The authentication token of the user to connect as. |
Returns
| Type | Description |
|---|---|
| Task | An async |
RegisterClient()
Assigns reponse methods to the OnReady, OnLogData, OnWsMessage and
OnError events of the internal client object. Requires initialization to happen
first.
Declaration
public virtual void RegisterClient()
UnregisterClient()
Removes reponse methods from the OnReady, OnLogData, OnWsMessage and
OnError events of the internal client object. Since the internal client also gets disposed,
initialization will need to happen again.
Declaration
public virtual void UnregisterClient()