Table of Contents

Workflow_ARSession example explained

Workflow_ARSession is a lightweight AR session management example designed to demonstrate how to build a complete AR application flow with minimal dependencies. This example supports both AR Foundation-compatible mode and simple mode, allowing you to flexibly choose based on project requirements.

How to use

Scene selection (choose one)

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

Configuration name Applicable scenario Dependency
ARFoundationCompatibleSceneSetup Projects already using or planning to integrate AR Foundation Requires completion of AR Foundation configuration
SimpleSceneSetup Does not rely on AR Foundation, directly uses EasyAR native capabilities No additional dependencies, suitable for lightweight AR applications

Build and run

  1. Add Workflow_ARSession to the menu bar File > Build Settings or Build Profiles > Scene List.
  2. Confirm the 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 the app launches, it will automatically initialize the camera and wait for target recognition.

Identify targets and acquisition methods

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

Default target: namecard.jpg

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

How to replace the target?

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

Expected effect

When the camera is aimed at 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 position, orientation, and scale of the panda are strictly bound to the pose of the image target. Even if the image moves, is partially occluded, or changes in lighting, it can still be tracked stably.

Extension suggestions

  • Add object tracking: Replace ImageTracker with ObjectTracker, load .obj model files;
  • Enable 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 feature components, please visit AR feature components.

With Workflow_ARSession, you can quickly master the core workflow of EasyAR and build production-level AR applications on this foundation.