Interface IReportDataSource
Interface for report data sources that can capture, analyze, and provide data for analyzer reports. Implementations of this interface handle the collection and management of specific types of data used by analyzer reports, such as asset information, performance metrics, or project statistics.
Namespace: UnityEditor.U2D.Tooling.Analyzer
Assembly: Unity.2D.Tooling.Editor.dll
Syntax
public interface IReportDataSource
Properties
capturing
Gets a value indicating whether a data capture operation is currently in progress.
Declaration
bool capturing { get; }
Property Value
| Type | Description |
|---|---|
| bool |
lastCaptureTime
Gets the last time the data source captured data.
Declaration
long lastCaptureTime { get; }
Property Value
| Type | Description |
|---|---|
| long |
name
Gets the human-readable name of this data source. This name is typically used for display purposes in the UI and for identification.
Declaration
string name { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
Capture(string[])
Starts capturing data from the specified asset search paths. This method initiates the data collection process and may run asynchronously.
Declaration
void Capture(string[] assetSearchPath)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | assetSearchPath | Array of asset paths to search and capture data from. |
Dispose()
Performs cleanup operations and releases any resources used by the data source. This method should be called when the data source is no longer needed.
Declaration
void Dispose()
Load(ISaveFile)
Loads previously saved data source state from the specified save file. This restores the data source to a previously captured state without needing to recapture.
Declaration
void Load(ISaveFile saveData)
Parameters
| Type | Name | Description |
|---|---|---|
| ISaveFile | saveData | The save file interface to read data from. |
Save(ISaveFile)
Saves the current data source state to the specified save file. This allows the data source's captured data to be persisted for later use.
Declaration
void Save(ISaveFile saveData)
Parameters
| Type | Name | Description |
|---|---|---|
| ISaveFile | saveData | The save file interface to write data to. |
StopCapture()
Stops the current data capture operation if one is in progress. This method should gracefully halt any ongoing capture processes.
Declaration
void StopCapture()
Events
onCaptureEnd
Event raised when a data capture operation completes. This signals that the capture process has finished, either successfully or due to cancellation.
Declaration
event Action<IReportDataSource> onCaptureEnd
Event Type
| Type | Description |
|---|---|
| Action<IReportDataSource> |
onCaptureStart
Event raised when a data capture operation begins. This allows subscribers to respond to the start of data collection, such as showing progress indicators.
Declaration
event Action<IReportDataSource> onCaptureStart
Event Type
| Type | Description |
|---|---|
| Action<IReportDataSource> |
onDataSourceChanged
Event raised when the data source's underlying data has changed. Subscribers can use this to update their reports or UI when new data becomes available.
Declaration
event Action<IReportDataSource> onDataSourceChanged
Event Type
| Type | Description |
|---|---|
| Action<IReportDataSource> |