How immersal/imdk-unity works
The Immersal SDK Core project is a Unity package designed for augmented reality (AR) mapping and localization, built on Unity (2022.3 LTS and AR Foundation 5.1+). The package is split primarily into Editor components (for tooling and editor integration) and Runtime components (which include core functionality, plugins, and resource assets). In addition, there is a Samples~/ folder that provides demo scenes, scripts, and resources for testing and illustrating how the SDK works in practice.
Main Components
• Editor Module: Contains all scripts, utilities, and custom editors (e.g., Localization editors, validation components, and specialized UI drawers) to integrate the SDK with the Unity Editor.
• Runtime Module: Includes core assembly definitions, library scripts, and plugins for different platforms (Android, iOS, WSA, x86_64). Also contains assets such as shaders, prefabs, and resources that are loaded during application runtime.
• Platform Plugins: Separate directories under Runtime/Plugins for Android, iOS, WSA, etc., encapsulating native bindings and platform-specific functionality.
• Samples/Examples: Demonstration projects and scenes (e.g., ContentPlacementSample, NavigationSample, etc.) that show how to use the SDK’s features. These provide a practical view of how the components interact.
• Supporting Assets: Resources such as fonts, materials, models, textures, shaders, and sounds used by both runtime and sample scenes.
Relationships and Interactions
• The Editor module and its tools (found in the Editor folder) integrate closely with the Unity Editor environment, providing user interfaces, project validations and custom inspectors to facilitate proper setup and configuration of the AR functionalities.
• The Runtime module is the heart of the SDK. Its assembly definitions (asmdef files) and code files (under Runtime/Scripts) implement the core AR session management, mapping, data processing (such as filtering and localization), and interfaces for platform-specific operations.
• Runtime/Plugins host native libraries that bridge Unity with platform-specific SDKs (e.g., Android's AAR files, iOS native libraries) ensuring proper AR and mapping integrations.
• Samples serve as a showcase on how the runtime components (and possibly settings configured via the Editor scripts) work together to deliver an AR experience.
Architectural Patterns and Design Principles
• Separation of concerns: The division between Editor and Runtime code is clear, ensuring tools used during development do not pollute the final runtime build.
• Plugin-based architecture: With platform-specific plugins, the project demonstrates an extensible design to support multiple operating environments.
• Modular design via Assembly Definitions: asmdef files in both Editor and Runtime directories help encapsulate behaviors and simplify dependency management.
• Interfaces and abstraction: Several interfaces (e.g., ILocalizer, IImmersalSession) in the XR folder clearly promote loose coupling between system components.