Table of Contents

Workflow_arsession example detailed explanation

Workflow_ARSession is a lightweight AR session management example demonstrating how to build a complete AR application flow with minimal dependencies. It supports both AR Foundation-compatible mode and simple mode, allowing flexible selection based on project requirements.

Usage method

Scene selection (choose one)

In the Unity editor, the Workflow_ARSession scene contains two mutually exclusive configuration root objects. Activate only one group (ensure the other is inactive):

Configuration name Applicable scenario Dependencies
ARFoundationCompatibleSceneSetup Projects using or planning to integrate AR Foundation Requires AR Foundation configuration
SimpleSceneSetup No AR Foundation dependency, directly uses EasyAR native capabilities No additional dependencies, suitable for lightweight AR applications

Build and run

  1. Add Workflow_ARSession to File > Build Settings or Build Profiles > Scene List in the menu bar.
  2. Confirm build options in Project Settings > Player based on the target platform (e.g., Android or iOS).
  3. Build to a real device and run.

After launching, the application will automatically initialize the camera and wait for target recognition.

Recognition targets and acquisition methods

This example demonstrates image tracking by default, but its architecture can easily extend to object tracking, cloud recognition, and other modes.

Default target: namecard.jpg

  • Target type: 2D image (recommended print size ≥ 90mm × 54mm)
  • Download: 🔗 namecard
    namecard

How to replace targets?

  1. Place your image (JPG/PNG) in Assets/Samples/EasyAR Sense Unity Plugin/[version]/__All Samples__/Workflow/Workflow_ARSession/Targets.
  2. Select the ImageTarget-namecard component in the scene, and change Texture to your image in the Inspector's Image Target Controller (Script).
  3. Modify Name and Scale. Scale is the physical size of your target (unit: meters), based on the long edge of the image.
    Replace Image Target
  4. Save and rebuild.

Expected effect

When the camera aligns with the target image, the system will:

  1. Detect and track the image in real-time;
  2. Overlay a 3D panda on the image plane;

The panda's position, orientation, and scaling are strictly bound to the image target's pose. Tracking remains stable even during image movement, partial occlusion, or lighting changes.

Extension suggestions

  • Add object tracking: Replace ImageTracker with ObjectTracker and load .obj model files;
  • Integrate cloud recognition: Use CloudRecognizer instead of local target lists;
  • Multi-target support: Extend from a single image target to multiple images; the system will automatically handle concurrent tracking.
Tip

For more functional components, visit AR functional components.

Through Workflow_ARSession, you can quickly master EasyAR's core workflow and build production-level AR applications based on it.