/// <summary>
    /// Creates a prefab instance that matches the record type.
    /// </summary>
    /// <param name="type">
    /// The type of record
    /// </param>
    /// <returns>
    /// The prefab instance.
    /// </returns>
    private GameObject CreatePrefab(ReportEventTypes type)
    {
        switch (type)
        {
        case ReportEventTypes.GazeEnter:
        case ReportEventTypes.PointerEnter:
            return(GameObject.Instantiate(enterPrefab));

        case ReportEventTypes.GazeExit:
        case ReportEventTypes.PointerExit:
            return(GameObject.Instantiate(exitPrefab));

        default:
            return(GameObject.Instantiate(stayPrefab));
        }
    }
Example #2
0
 /// <summary>
 /// Initializes a new <see cref="ReportableFocusEvent"/>.
 /// </summary>
 /// <param name="packageToken">
 /// The package token that uniquely identifies the application.
 /// </param>
 /// <param name="entityName">
 /// The unique name of the entity where the event occurred.
 /// </param>
 /// <param name="sourceName">
 /// The name of the source that triggered the event.
 /// </param>
 /// <param name="eventType">
 /// The type of event that has occurred.
 /// </param>
 /// <param name="time">
 /// The time that the event occurred.
 /// </param>
 /// <param name="localPosition">
 /// The position that the event occurred in the entities local coordinate space.
 /// </param>
 /// <param name="worldPosition">
 /// The position that the event occurred in world space.
 /// </param>
 public ReportableFocusEvent(string packageToken, string entityName, string sourceName, ReportEventTypes eventType, DateTimeOffset time, Vector3 localPosition, Vector3 worldPosition)
 {
     this.PackageToken  = packageToken;
     this.EntityName    = entityName;
     this.SourceName    = sourceName;
     this.EventType     = eventType;
     this.Time          = time;
     this.LocalPosition = localPosition;
     this.WorldPosition = worldPosition;
 }
Example #3
0
 /// <summary>
 /// Gets a value that indicates if recording is enabled for the specified event type.
 /// </summary>
 /// <param name="eventType">
 /// The event type to check.
 /// </param>
 /// <returns>
 /// <c>true</c> if enabled; otherwise <c>false</c>.
 /// </returns>
 private bool IsEnabled(ReportEventTypes eventType)
 {
     return((eventType & ReportEvents) == eventType);
 }