How to Use - vmasc-capabilities-lab/RUDE GitHub Wiki

EventsManager

The EventsManager manages all logging events and coordinates uploading too desired location. This is required at the root of your scene.

Usage

To include an EventsManager in a scene there are two options:

  1. Import RUDE’s custom prefab via Unity Package Manager

Import custom prefab

  1. Create an empty game object with the name “RudeManager’ and attach EventsManager script to it. EventsLogger will search for a game object with the name “RudeManager” to access the Logger Class object

Once you've added an EventManager(RudeManager) to an empty game object at the root of your scene, you must populate the fields within the inspector (shown below)

EventsManager Inspector

  • Session Name for Log
    • Unique string identifier for the log session.
  • Write Log to
    • Where log files will be saved.
    • Currently supports 3 options
      1. Local
      2. Azure Blob Storage
      3. AWS S3

Once an option is selected, the inspector will update with new fields based upon the users selection.

Local

EventsManager local option

  • File Path To Write Logs To

    • The location you wish to store application log files to
    • Must be Absolute path
  • File Type

    • The type of file you wish to store the logs to
    • 3 Options currently supported:
      1. CSV
      2. JSON
      3. TEXT

Note: If you wish to not save any log files, leave this option on Local with the "File Path to Write Logs To" empty.

Azure Blob Storage

EventsManager azure option

  • Connection String

    • A connection string includes the authorization information required for your application to access data in an Azure Storage account at runtime using Shared Key authorization
    • This can be found with your Azure Storage Account Access Keys
  • File Type

    • The type of file you wish to store the logs to
    • 3 Options currently supported:
      1. CSV
      2. JSON
      3. TEXT

AWS S3

EventsManager was option

  • Access Key

    • An access key grants programmatic access to AWS resources
  • Secret Access Key

    • An access key grants programmatic access to AWS resource
  • File Type

    • The type of file you wish to store the logs to
    • 3 Options currently supported:
      1. CSV
      2. JSON
      3. TEXT

Once an EventsManager(RudeManager) is initialized and the above fields populated, you may begin attaching EventLogger scripts to objects within your project.

EventLogger

The EventLogger script, when attached to an object will log information for a specific Unity Event. It logs using a custom .NET Logging Class with a focus on logging events for generic research purposes/needs.

Usage

To use the EventLogger, attach it to a Unity Game Object that you wish to add logging functionality and populate the fields to match your needs.

EventLogger inspector

  • Verb
    • The action that has occurred
  • Object
    • What has been modified by the Verb
  • Payload
    • Additional information tied to this event. This can be anything from a detail separating it from others logged, or a small description
  • Options
    • Indicates which Unity Event you wish to log when it occurs. For example, "OnTriggerEnter" will fire any time the Subject enters another trigger during gameplay.
    • More on Unity Event System and Triggers can be found here

VR Demo Scene

To demonstrate the use of the package, a VR demo scene was created, which can be imported via the RUDE package in the Unity Package Manager.

Requirements

  • Unity Packages
    • RUDE
      • Version: 1.0.0
    • XR Interaction Toolkit
      • Version: 1.0.0-pre.06
    • XR Plugin Management
      • Version: 4.0.7
    • TMP Essentials
      • User will be prompted to download latest version

Import Demo Scene UPM

Once imported into your project, there should now be a "Samples" folder in your project and within this you will find an assortment of files/folders needed for the demo scene.

To open up the scene, navigate to the Scenes folder and open up the scene "VR Test" (shown below)

VR Test

Notes: This scene was created using modified versions of the EventsManager and EventsLogger in order to communicate information with objects in the scene. This will change in future versions as they should use unmodified versions of the EventsManager and EventLogger.