Class ServerManager
The class that manages Server instances.
Inherited Members
Namespace: Unity.LiveCapture
Assembly: Unity.LiveCapture.dll
Syntax
public class ServerManager : ScriptableObject
Properties
Instance
The ServerManager instance.
Declaration
public static ServerManager Instance { get; }
Property Value
| Type | Description |
|---|---|
| ServerManager |
Servers
The servers that are currently active.
Declaration
public IReadOnlyList<Server> Servers { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<Server> |
Methods
CreateServer(Type)
Creates a server of a specified type.
Declaration
public Server CreateServer(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type of server to create. |
Returns
| Type | Description |
|---|---|
| Server | The server instance. |
Remarks
Only one instance of each server may be created at a time.
If a server of type type already exists, it
is returned instead of a new instance.
DestroyServer(Server)
Destroys a server.
Declaration
public void DestroyServer(Server server)
Parameters
| Type | Name | Description |
|---|---|---|
| Server | server | The server to destroy. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |
| ArgumentException | Thrown if |
HasServer(Type)
Checks if a server of the given type exists.
Declaration
public bool HasServer(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type | The type of server to check. |
Returns
| Type | Description |
|---|---|
| bool | True if a server of the type exists; false otherwise. |
TryGetServer<TServer>(out TServer)
Gets the server of a specified type, if it exists.
Declaration
public bool TryGetServer<TServer>(out TServer server) where TServer : Server
Parameters
| Type | Name | Description |
|---|---|---|
| TServer | server | The returned server, or default if there is no matching server instance. |
Returns
| Type | Description |
|---|---|
| bool | True if a matching server instance was found; false otherwise. |
Type Parameters
| Name | Description |
|---|---|
| TServer | The type of the server to get. |
Events
ServerCreated
An event invoked when a Server is added to the manager.
Declaration
public static event Action<Server> ServerCreated
Event Type
| Type | Description |
|---|---|
| Action<Server> |
ServerDestroyed
An event invoked when a Server is removed from the manager.
Declaration
public static event Action<Server> ServerDestroyed
Event Type
| Type | Description |
|---|---|
| Action<Server> |