com.rwth.unity.omilaxr.xapi4unity
v2.2.3
Published
This is an package with has editor tools to use work with xAPI definitions more easy. Developers can design xAPI definitions and transform them directly to C# code.
Readme
xAPI4Unity
xAPI4Unity is a Unity package designed to bridge xAPI functionalities into Unity projects conveniently. It enables seamless integration of xAPI JSON definitions and transforms them into C# scripts you can use in your applications. This tool provides support for xAPI registry handling, editor tools, and watcher-based transformations.
Key Features
- Transform xAPI JSON definitions into C# scripts directly in Unity.
- Built-in JSON watcher to auto-reflect changes (optional).
- Fetch and manage xAPI definitions from local or Git repositories.
- Easy-to-use Unity editor interface for managing definitions.
- Fully compatible with Unity LTS versions.
Tested Unity Versions
- [ ] Unity 2019.4.40f1 (LTS)
- [X] Unity 2020.3.48f1 (LTS)
- [X] Unity 2021.3.45f1 (LTS)
- [X] Unity 2022.3.52f1 (LTS)
- [ ] Unity 2023 (no LTS)
- [X] Unity 6 (LTS)
Getting Started
Step-by-Step Guide
- Install the xAPI4Unity package: Follow the installation instructions below.
- Set up xAPI Registry: Go to
Unity Menu > xAPI4Unity > Setup xAPI definitions. Select how you want to fetch the xAPI registry:- Clone from a Git repository.
- Use a local directory containing the xAPI registry definitions.
- Edit and transform JSON files: Use the
Assets/xapifolder for your xAPI JSON files. Changes are automatically transformed into C# if the watcher is enabled. Alternatively, use theUpdate xAPI.Registrybutton for manual transformation. - Manual Transformation: Use the Unity menu
xAPI4Unity > Update xAPI.Registry (JSON => C#)to trigger transformation manually if required. - View Documentation: Open
https://xapi.elearn.rwth-aachen.deviaxAPI4Unity > Open registry pagein the Unity menu for more information.
Installation
Option 1: Add Scoped Registry via manifest.json
- Open
Packages/manifest.jsonin your Unity project root. - Add the following scoped registry configuration:
"scopedRegistries": [ { "name": "npmjs", "url": "http://registry.npmjs.com/", "scopes": [ "com.rwth.unity.omilaxr.xapi4unity" ] } ] - Add the
com.rwth.unity.omilaxr.xapi4unityscope if another registry is already defined. - Open Unity's Package Manager, go to
My Registries, and installcom.rwth.unity.omilaxr.xapi4unity.
Option 2: Using Scoped Registry from Project Settings
- Navigate to
Project Settings > Package Manager. - Add the following scoped registry:
- Name: npmjs
- URL:
http://registry.npmjs.com - Scope(s):
com.rwth.unity.omilaxr.xapi4unity
- Open Package Manager, select
Add package by name, and inputcom.rwth.unity.omilaxr.xapi4unity.
Option 3: Using Git URL
- Go to Package Manager.
- Select
Add package from git URL. - Paste
https://gitlab.com/learntech-rwth/omilaxr-ecosystem/xapi-4-unity.gitand clickAdd.
Setup Guide
JSON Definitions Location
You need a source for xAPI Registry definitions for transformation:
- Git Repository: Fetch definitions directly from a published GitLab repository (requires git CLI installed).
- Local Source: Select a local directory with the
definitionsfolder at its root.
Fetcher Configuration
- Configure where the generated C# files from xAPI definitions will be saved. For example, you can set this to
./Assets.
JSON Watcher
- When enabled, xAPI4Unity automatically detects changes in JSON files in the
Assets/xapifolder and triggers transformation into C#. The watcher is enabled by default but can be disabled via settings.
Developer Notes
Contributing
Feel free to create pull requests or raise issues to help improve xAPI4Unity. Contributions are always welcome.
License
This project is licensed under the AGPL-3.0-or-later. See the LICENSE file for details.
Support
For further assistance, please visit xAPI Registry Documentation or raise an issue in the repository.
