Class AdaptivePerformanceSubsystemBase<TSubsystem, TSubsystemDescriptor, TProvider>
Base class for subsystems to create your custom provider subsystem to deliver data from your provider to Adaptive Performance.
Namespace: UnityEngine.AdaptivePerformance.Provider
Syntax
public abstract class AdaptivePerformanceSubsystemBase<TSubsystem, TSubsystemDescriptor, TProvider> : SubsystemWithProvider<TSubsystem, TSubsystemDescriptor, TProvider> where TSubsystem : SubsystemWithProvider, new()
where TSubsystemDescriptor : SubsystemDescriptorWithProvider where TProvider : SubsystemProvider<TSubsystem>
Type Parameters
| Name | Description |
|---|---|
| TSubsystem | Concrete subsystem deriving from AdaptivePerformanceSubsystemBase. |
| TSubsystemDescriptor | The subsystem descriptor for the underlying subsystem. |
| TProvider | Provider type for the AdaptivePerformanceSubsystem-derived subsystem. |
Properties
ApplicationLifecycle
Application lifecycle events to be consumed by subsystem. Can be null if the subsystem does not need special handling on life-cycle events. The returned reference does not change after startup.
Declaration
public abstract IApplicationLifecycle ApplicationLifecycle { get; }
Property Value
| Type | Description |
|---|---|
| IApplicationLifecycle | Application lifecycle object |
Capabilities
Bitset of supported features. Does not change after startup.
Declaration
public abstract Feature Capabilities { get; protected set; }
Property Value
| Type | Description |
|---|---|
| Feature | Bitset |
Initialized
Returns if the subsystem is initialized successfully.
Declaration
public abstract bool Initialized { get; protected set; }
Property Value
| Type | Description |
|---|---|
| Boolean | Boolean to tell if subsystem was initialized successfully. |
PerformanceLevelControl
Control CPU or GPU performance levels of the device. Can be null if the subsystem does not support controlling CPU/GPU performance levels. Is null when the PerformanceLevelControl bit is not set in Capabilities. The returned reference does not change after startup.
Declaration
public abstract IDevicePerformanceLevelControl PerformanceLevelControl { get; }
Property Value
| Type | Description |
|---|---|
| IDevicePerformanceLevelControl | Performance level control object |
Stats
Generates a human readable string of subsystem internal stats. Optional and only used for development.
Declaration
public abstract string Stats { get; }
Property Value
| Type | Description |
|---|---|
| String | String with subsystem specific statistics |
Version
Returns the version of the subsystem implementation. Can be used together with SubsystemDescriptor to identify a subsystem.
Declaration
public abstract Version Version { get; }
Property Value
| Type | Description |
|---|---|
| Version | Version number |
Methods
Update()
To be called once per frame. The returned data structure's fields are populated with the latest available data, according to the supported Capabilities.
Declaration
public abstract PerformanceDataRecord Update()
Returns
| Type | Description |
|---|---|
| PerformanceDataRecord | Data structure with the most recent performance data. |