How can we help?
Scripts and prefabs included in Augumenta Unity3D plugin
Augumenta AIP plugin contains few predefined scripts that can be used as-is to easily integrate the detection with the Unity3D game objects. They can also be extended to fit the needs of the application.
Scripts
AugumentaInit
Augumenta AIP initialization script. This must be included in every project that uses Augumenta AIP. It also needs to be executed before you are using any of the Augumenta AIP features.
IMPORTANT NOTE: Make sure that the AugumentaInit
script is executed before any other script that is using Augumenta AIP functionality. To ensure that is loaded first, change the Edit -> Project Settings -> Script Execution Order
to load it before the default time.
AgapiDebugListener
Global listener for all registered events that are triggered from the Augumenta AIP. It will print the selected events to the console. You can select, from the inspector, which events are printed in console.
WebCamHandler
Example implementation for using Unity3D WebCam as a camera frame source for the Augumenta AIP. It has configurations for the camera resolution and field- of-view. It is also responsible for drawing the camera preview in a texture when the preview needs to be shown to the user.
PoseHandler
PoseHandler
is used for registering and listening to pose events. Note that PoseHandler
implementation has a limitation that each script instance can only register and listen to a single pose at the time. To listen to multiple poses, use multiple instances of the script.
PoseHandler
manages pose registration and unregistration in the life-cycle of the script. As a default it will only register and listen events while the script is active. This can be used to easily enable/disable detection at runtime.
PoseHandler
has two extend-able methods, OnPose
and OnPoseLost
, which are called when the event that the handler is listening for occurs. This script is used as a base script for other scripts that rely on pose detection.
TransitionHandler
TransitionHandler
is used for registering and listening to transition events. Note that TransitionHandler
implementation has a limitation that each script instance can only register and listen for a single transition at the time. To listen to multiple transitions, use multiple instances of the script.
TransitionHandler
manages transition registration and unregistration in the life-cycle of the script. As a default it will only register and listen events while the script is active. This can be used to easily enable/disable detection at runtime.
TransitionHandler
has one extend-able method, OnTransition
, which is called when event, this handler is listening for, occures.
PathHandler
PathHandler
is used for registering and listening to path events. Note that PathHandler
implementation has a limitation that each script instance can only register and listen for one singe gesture at the time. To listen to multiple paths, use multiple instances of the script.
PathHandler
manages path registration and unregistration in the life-cycle of the script. As a default it will only register and listen events while the script is active. This can be used to easily enable/disable detection at runtime.
PathHandler
has one extend-able method, OnPath
, which is called when the event that the handler is listening for occurs.
HoverPoseHandler
HoverPoseHandler
extends the PoseHandler
and triggers callback methods if the registered pose event overlaps the attached game object in 2D. It has two extend-able methods, OnHoverEnter
and OnHoverLeave
, which are called when the pose event enters and leaves the attached game object.
This is a simple example of how to extend PoseHandler
.
FollowPoseHandler
FollowPoseHandler
extends the PoseHandler
and makes the attached game object to “follow” the registered pose. In inspector the script has settings for adjusting how the game object follows the events.
This is a simple example of how to extend PoseHandler
.
ClickHandler
ClickHandler
extends the HoverPoseHandler
. It simulates the clicking of the game object by calling OnClick
methods after the pose hovers long enough on the game object.
This is a simple example of how to extend HoverPoseHandler
.
Prefabs
SimpleWebCamPreview
Prefab for setting up Augumenta AIP with Unity3D WebCam as a camera frame source. This prefab contains all the essentials for setting up the Augumenta AIP with camera preview shown as a background.