Class SubjectRecorder
Inheritance
Inherited Members
Namespace: RecordAndPlay.Record
Assembly: RecordAndPlay.dll
Syntax
public class SubjectRecorder
Constructors
SubjectRecorder(ISubject, String, Dictionary<String, String>, Single)
Builds a new recorder.
Declaration
public SubjectRecorder(ISubject subject, string name, Dictionary<string, string> metadata, float minimumDelta)
Parameters
Type | Name | Description |
---|---|---|
ISubject | subject | What we are observing. |
System.String | name | Name of the subject to be used as reference. If no name is provided the GameObject's name is substituted. |
System.Collections.Generic.Dictionary<System.String, System.String> | metadata | Any initial metadata to be associated with the recording. |
System.Single | minimumDelta | How much the position or rotation must change before it's considered different. |
SubjectRecorder(GameObject, String, Dictionary<String, String>, Single)
Declaration
public SubjectRecorder(GameObject subject, string name, Dictionary<string, string> metadata, float minimumDelta)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.GameObject | subject | |
System.String | name | |
System.Collections.Generic.Dictionary<System.String, System.String> | metadata | |
System.Single | minimumDelta |
Methods
Capture(Single)
Captures the position and rotation of the current subject.
Declaration
public void Capture(float time)
Parameters
Type | Name | Description |
---|---|---|
System.Single | time | Time of the capture. |
Remarks
This function determines whether or not it can drop previous captures to save space. If the subject is moving in a predictable fashion, then it might drop some positional frames for the sake of memory. This will not reduce the quality of the recording.
CaptureCustomEvent(Single, String, Dictionary<String, String>)
If you want to keep up with something special that occured at a certain time in your recording, then you can call this function with the details of the special event.
Declaration
public void CaptureCustomEvent(float time, string name, Dictionary<string, string> contents)
Parameters
Type | Name | Description |
---|---|---|
System.Single | time | Time the event occured. |
System.String | name | Name of the event. |
System.Collections.Generic.Dictionary<System.String, System.String> | contents | Details of the event. |
CaptureCustomEvent(Single, String, String)
If you want to keep up with something special that occured at a certain time in your recording, then you can call this function with the details of the special event.
Declaration
public void CaptureCustomEvent(float time, string name, string contents)
Parameters
Type | Name | Description |
---|---|---|
System.Single | time | Time the event occured. |
System.String | name | Name of the event. |
System.String | contents | Details of the event. |
CaptureUnityEvent(Single, UnityLifeCycleEvent)
Logs a lifecycle event at a given time.
Declaration
public void CaptureUnityEvent(float time, UnityLifeCycleEvent lifeCycleEvent)
Parameters
Type | Name | Description |
---|---|---|
System.Single | time | Time of the event. |
UnityLifeCycleEvent | lifeCycleEvent | The lifecycle event to log. |
GetSubject()
The subject being recorded.
Declaration
public ISubject GetSubject()
Returns
Type | Description |
---|---|
ISubject | The subject being recorded. |
Save(Single, Single, IEnumerable<Vector2>)
Takes what events have been witnessed up until now and builds a recording from them.
Declaration
public SubjectRecording Save(float startTime, float endTime, IEnumerable<Vector2> pauseSlices)
Parameters
Type | Name | Description |
---|---|---|
System.Single | startTime | The minimum timestamp the events must have. |
System.Single | endTime | The maximum timestamp the events can have. |
System.Collections.Generic.IEnumerable<UnityEngine.Vector2> | pauseSlices | Any time ranges you want to exclude events from in the final recording. |
Returns
Type | Description |
---|---|
SubjectRecording |
SetMetaData(String, String)
Keep up with custom data associated with the subject.
Declaration
public void SetMetaData(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Name of the custom data. |
System.String | value | Details of the custom data. |