Class RuntimeNetStatsMonitor
The Runtime Net Stats Monitor component. Add this component to a game object in a scene to display network statistics on screen.
Inherited Members
Namespace: Unity.Multiplayer.Tools.NetStatsMonitor
Assembly: Unity.Multiplayer.Tools.NetStatsMonitor.Component.dll
Syntax
[AddComponentMenu("Netcode/Runtime Network Stats Monitor")]
public class RuntimeNetStatsMonitor : MonoBehaviour
Properties
Configuration
The configuration asset used to configure the information displayed in this Runtime Net Stats Monitor. The NetStatsMonitorConfiguration can created from the Create menu, or from C# using ScriptableObject.CreateInstance.
Declaration
[CanBeNull]
public NetStatsMonitorConfiguration Configuration { get; set; }
Property Value
Type | Description |
---|---|
Net |
CustomStyleSheet
Custom stylesheet to override the default style of the Runtime Net Stats Monitor.
Declaration
public StyleSheet CustomStyleSheet { get; set; }
Property Value
Type | Description |
---|---|
Style |
MaxRefreshRate
The maximum rate at which the Runtime Net Stats Monitor's on-screen display is updated (per second). The on-screen display will never be updated faster than the overall refresh rate. The default refresh rate is 30fps.
Declaration
public double MaxRefreshRate { get; set; }
Property Value
Type | Description |
---|---|
double |
PanelSettingsOverride
Optional panel settings that can be used to override the default. These panel settings can be used to control a number of things, including how the on-screen display of the Runtime Net Stats Monitor scales on different devices and displays.
Declaration
public PanelSettings PanelSettingsOverride { get; set; }
Property Value
Type | Description |
---|---|
Panel |
Position
Position configuration that allows custom positioning on screen The default position is the top left corner of the screen
Declaration
public PositionConfiguration Position { get; set; }
Property Value
Type | Description |
---|---|
Position |
Visible
Visibility toggle to hide or show the on-screen display.
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
AddCustomValue(MetricId, float)
Add a custom value for this metricId, which can be displayed in the RuntimeNetStatsMonitor using a counter or graph configured to display this metric.
Declaration
public void AddCustomValue(MetricId metricId, float value)
Parameters
Type | Name | Description |
---|---|---|
Metric |
metricId | The custom Metric |
float | value | The value of the metric. |
ApplyConfiguration()
Apply the CustomStyleSheet, Position, and Configuration to the monitor. This function must be called when these fields have been modified from C# in order to apply the changes. This function does not need to be called when these fields are modified in the inspector, as changes made in the inspector are detected and applied automatically
Declaration
public void ApplyConfiguration()