Samples
ConjureKit Manna Module package includes basic samples that demonstrate the basic features of Manna module.
Requirements
- Aukiverse app key and secret
- Unity project with ConjureKit and Manna packages
Basics
The example code in the Demo sample demonstrates how to use Manna to instantly join and calibrate into a Session by scanning a QR code.
Import
Import the Demo sample from the package manager
Open the
Main
scene inAssets/Samples/Auki Labs ConjureKit Manna Module/0.5.*/Demo/Scenes
Insert your Aukiverse console app key and secret in
Main.cs
underAssets/Samples/Auki Labs ConjureKit Manna Module/0.5.*/Demo/Scripts
_conjureKit = new ConjureKit(ConjureKitConfiguration.Get(), cameraTransform, "insert_app_key_here", "insert_app_secret_here");
Overview
Build and run the sample on two smartphones.
Showing/Hiding QR lighthouse
Clicking the QR button will invoke SetLighthouseVisible method on Manna module to show or hide the QR code.
public void ToggleLighthouse() => _manna.SetLighthouseVisible(qrCodeToggle.isOn);
Instant calibration
Now if you scan the QR code on the second iPhone it should automatically join the session with shared coordinate system, display the same session id and show a primitive cube on top of first device's QR code.
Custom Lighthouse tracked event
Import
Import the OnLighthouseTracked Demo sample from the package manager
Open the
Main
scene inAssets/Samples/Auki Labs ConjureKit Manna Module/0.5.*/OnLighthouseTracked Demo/Scenes
Insert your Aukiverse console app key and secret in
Main.cs
underAssets/Samples/Auki Labs ConjureKit Manna Module/0.5.*/OnLighthouseTracked Demo/Scripts
_conjureKit = new ConjureKit(ConjureKitConfiguration.Get(), cameraTransform, "insert_app_key_here", "insert_app_secret_here");
Overview
You can register a custom handler when initializing the Manna module to be called when a lighthouse (QR code) is scanned.
_manna = new Manna(conjureKit);
_manna.OnLighthouseTracked = UpdateStatusLabel;
private void UpdateStatusLabel(Lighthouse lighthouse, Pose pose, bool isCloseEnough)
{
statusLabel.text = $"Lighthouse data:\n" +
$"Type: {lighthouse.Type}\n" +
$"Id: {lighthouse.Id}\n" +
$"Position: {pose.position:0.00}\n" +
$"Rotation: {pose.rotation.eulerAngles:0.00}";
}