Class Capture
Encompasses an event that occured at a certian point in time during a recording. Meant to be immutable.
Inherited Members
Namespace: RecordAndPlay
Assembly: RecordAndPlay.dll
Syntax
public abstract class Capture
Constructors
Capture(Single)
Declaration
public Capture(float time)
Parameters
Type | Name | Description |
---|---|---|
System.Single | time |
Properties
Time
The time the event was captured in the recording.
Declaration
public float Time { get; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
FallsWithin(Single, Single)
Figure out if the captured event occurs within the time slice provided. The range is inclusive [start, end]. If the range is provided backwards such that the start of the timeslice occurs after the end (start > end), then the values are automatically flipped and the function continues.
Declaration
public bool FallsWithin(float start, float end)
Parameters
Type | Name | Description |
---|---|---|
System.Single | start | The start of the timeslice. |
System.Single | end | The end of the timeslice. |
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the event occurs within the timeslice. |
FallsWithin(Vector2)
Figure out if the captured event occurs within the time slice provided. The range is inclusive [timeSlice.x, timeSlice.y]. If the range is provided backwards such that the start of the timeslice occurs after the end (timeSlice.x > timeSlice.y), then the values are automatically flipped and the function continues.
Declaration
public bool FallsWithin(Vector2 timeSlice)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Vector2 | timeSlice | The timeslice where the x component is the start and the y component is the end. |
Returns
Type | Description |
---|---|
System.Boolean | Whether or not the event occurs within the timeslice |
SetTime(Single)
Builds a new capture object that has a modified capture time. The original capture object is left unchanged.
Declaration
public abstract Capture SetTime(float newTime)
Parameters
Type | Name | Description |
---|---|---|
System.Single | newTime | The new time the capture occured. |
Returns
Type | Description |
---|---|
Capture | A new capture object with the capture time set to the value passed in. |
ToCSV()
Builds a string that represents a single row in a csv file that contains this object's data.
Declaration
public abstract string ToCSV()
Returns
Type | Description |
---|---|
System.String | A row of csv data as a string. |
ToJSON()
Builds a JSON string that represents the Capture.
Declaration
public abstract string ToJSON()
Returns
Type | Description |
---|---|
System.String | A JSON string. |