Class TimestampNameComponent
NameComponent that adds a UTC timestamp to the path.
Inherited Members
Namespace: Unity.Simulation
Assembly: Unity.Simulation.Core.dll
Syntax
[Serializable]
public class TimestampNameComponent : NameComponent
Constructors
TimestampNameComponent()
Default Constructor
Declaration
public TimestampNameComponent()
TimestampNameComponent(string, string, int, TimerSource)
Constructor to pass in the affixes.
Declaration
public TimestampNameComponent(string prefix = "", string suffix = "", int digitsOfPrecision = 0, TimerSource timerSource = TimerSource.UnixEpoch)
Parameters
| Type | Name | Description |
|---|---|---|
| string | prefix | This will be prepended to the output from this NameComponent |
| string | suffix | This will be appended to the output from this NameComponent |
| int | digitsOfPrecision | Number of digits of precision to use for the timer's string representation |
| TimerSource | timerSource | Type of time data to retrieve from the timer |
Fields
digitsOfPrecision
Specifies the number of digits of precision for the string representation.
Declaration
public int digitsOfPrecision
Field Value
| Type | Description |
|---|---|
| int |
timerSource
Specifies the timer to use, which allows you to specify the time source.
Declaration
public TimerSource timerSource
Field Value
| Type | Description |
|---|---|
| TimerSource |
Methods
Generate(string, bool)
Returns the current UTC timestamp.
Declaration
public override string Generate(string path, bool modify = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | path | Base path used to generate a new path. |
| bool | modify | If false, the NameComponent will not modify its state. This is equivalent to Reset() followed by Generate(). |
Returns
| Type | Description |
|---|---|
| string | The path component generated by this NameComponent |