Class Manager
The primary manager class for the SDK. Responsible for tracking data produced, uploading it, and waiting for it to complete.
Namespace: Unity.Simulation
Syntax
public sealed class Manager
Fields
ShutdownNotification
Delegate which is called when the SDK is shutting down.
Declaration
public Manager.NotificationDelegate ShutdownNotification
Field Value
| Type | Description |
|---|---|
| Manager.NotificationDelegate |
StartNotification
Delegate which is called when the SDK starts.
Declaration
public Manager.NotificationDelegate StartNotification
Field Value
| Type | Description |
|---|---|
| Manager.NotificationDelegate |
Tick
Delegate for receiving per frame ticks.
Declaration
public Manager.TickDelegate Tick
Field Value
| Type | Description |
|---|---|
| Manager.TickDelegate |
Properties
FinalUploadsDone
Returns a boolean indicating if all uploads to the cloud storage are done.
Declaration
public static bool FinalUploadsDone { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
Instance
Declaration
public static Manager Instance { get; }
Property Value
| Type | Description |
|---|---|
| Manager |
ProfilerEnabled
Accessor to enable/disable the profiler.
Declaration
public bool ProfilerEnabled { get; set; }
Property Value
| Type | Description |
|---|---|
| Boolean |
ProfilerPath
Returns the path to the profiler log.
Declaration
public string ProfilerPath { get; }
Property Value
| Type | Description |
|---|---|
| String |
requestPoolCount
Returns AsyncRequests pool count.
Declaration
public int requestPoolCount { get; }
Property Value
| Type | Description |
|---|---|
| Int32 |
ShutdownCondition
Declaration
public ICondition ShutdownCondition { get; set; }
Property Value
| Type | Description |
|---|---|
| ICondition |
ShutdownRequested
Returns a boolean indicating if shutdown has been requested.
Declaration
public static bool ShutdownRequested { get; }
Property Value
| Type | Description |
|---|---|
| Boolean |
SimulationElapsedTime
Returns Simulation time elapsed in seconds.
Declaration
public double SimulationElapsedTime { get; }
Property Value
| Type | Description |
|---|---|
| Double |
SimulationElapsedTimeUnscaled
Returns unscaled simulation time in seconds.
Declaration
public double SimulationElapsedTimeUnscaled { get; }
Property Value
| Type | Description |
|---|---|
| Double |
WallElapsedTime
Returns Wall time elapsed in seconds.
Declaration
public double WallElapsedTime { get; }
Property Value
| Type | Description |
|---|---|
| Double |
Methods
CompleteTrackedRequests(Boolean)
Declaration
public void CompleteTrackedRequests(bool allRequests = false)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | allRequests |
ConsumerFileProduced(String, Boolean, Boolean)
Inform the manager that file is produced and is ready for upload.
Declaration
public void ConsumerFileProduced(string filePath, bool synchronous = false, bool isArtifact = true)
Parameters
| Type | Name | Description |
|---|---|---|
| String | filePath | Full path to the file on the local file system |
| Boolean | synchronous | boolean indicating if the upload is to be done synchronously. |
| Boolean | isArtifact | A flag indicating if the file being consumed is an artifact or not. |
CreateRequest<T>()
Create an instance of an AsyncRequest.
Declaration
public T CreateRequest<T>()
where T : AsyncRequest, new()
Returns
| Type | Description |
|---|---|
| T | AsyncRequest of type T. |
Type Parameters
| Name | Description |
|---|---|
| T | AsyncRequest type. |
GetDirectoryFor(String, String)
Declaration
public string GetDirectoryFor(string type = "", string userPath = "")
Parameters
| Type | Name | Description |
|---|---|---|
| String | type | |
| String | userPath |
Returns
| Type | Description |
|---|---|
| String |
GetRequestsCount(Type)
Declaration
public int GetRequestsCount(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| Type | type |
Returns
| Type | Description |
|---|---|
| Int32 |
LateUpdate()
Declaration
public void LateUpdate()
QueueEndOfFrameItem(Action<Object>, Object)
Queues an action/callback to be executed at the end of the frame.
Declaration
[Obsolete("QueueEndOfFrameItem is obsolete, use QueueForEndOfFrame instead.")]
public void QueueEndOfFrameItem(Action<object> callback, object functor)
Parameters
| Type | Name | Description |
|---|---|---|
| Action<Object> | callback | Callback action that needs to be invoked at the end of the frame. |
| Object | functor | Functor that needs to be passed to the callback as an argument. |
QueueForEndOfFrame(Action)
Queues an action/callback to be executed at the end of the frame.
Declaration
public void QueueForEndOfFrame(Action action)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action |
QueueForMainThread(Action)
Queues an action to be executed at the beginning of the next update. This is preferred to the QueueEndOfFrameItem, which will be deprecated in the future.
Declaration
public void QueueForMainThread(Action action)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | action | Action that needs to be invoked. |
RecycleRequest<T>(T)
Recycle the async request and put it back in the pool.
Declaration
public void RecycleRequest<T>(T request)
where T : AsyncRequest
Parameters
| Type | Name | Description |
|---|---|---|
| T | request | AsyncRequest to be recycled. |
Type Parameters
| Name | Description |
|---|---|
| T | AsyncRequest type T. |
RegisterDataConsumer(IDataProduced)
Register a consumer for the data being generated.
Declaration
public void RegisterDataConsumer(IDataProduced consumer)
Parameters
| Type | Name | Description |
|---|---|---|
| IDataProduced | consumer | IDataProduced consumer to be added to the list of consumers. |
Shutdown()
Begins shutting down the SDK. Shutdown will last until all uploads or any other consumption has completed.
Declaration
public void Shutdown()
ShutdownAfterFrames(Int32)
Shutdown after the specified number of frames have elapsed.
Declaration
public void ShutdownAfterFrames(int frameCount)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | frameCount | Number of frames to elapse before exiting the simulation. |
ShutdownAfterSimSeconds(Double)
Shutdown after the specified number of simulation seconds (scaled) have passed.
Declaration
public void ShutdownAfterSimSeconds(double seconds)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | seconds | Number of seconds to pass before exiting the simulation. |
ShutdownAfterWallSeconds(Double)
Shutdown after the specified number of wall seconds have passed.
Declaration
public void ShutdownAfterWallSeconds(double seconds)
Parameters
| Type | Name | Description |
|---|---|---|
| Double | seconds | Number of seconds to pass before exiting the simulation. |
UnhandledExceptionHandler(Object, UnhandledExceptionEventArgs)
Declaration
public static void UnhandledExceptionHandler(object sender, UnhandledExceptionEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | sender | |
| UnhandledExceptionEventArgs | args |
UnregisterDataConsumer(IDataProduced)
Remove the consumer from the list of consumers
Declaration
public void UnregisterDataConsumer(IDataProduced consumer)
Parameters
| Type | Name | Description |
|---|---|---|
| IDataProduced | consumer | IDataProduced consumer to be removed from the list. |
Update()
Declaration
public void Update()
UploadTracesFromPreviousRun(String)
Upload the data from the previous run.
Declaration
public void UploadTracesFromPreviousRun(string path)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | Full path to the directory containing data from the previous run. |