ARMOD APIs
AR-MOD API is an indispensable code script interface in the AR-MOD framework.It allows us to write complex scripts to produce our AR creative interactive content.The content developed by this API

UGUI

IsPointerOverUi

It is used to determine whether ugui objects are touched. Prevent raycast ray penetration when clicking ugui objects.
Return:True:Touch ugui object,False:Not touching the UGUI object
It is need a GraphicRaycaster component in the ARExperience package!
1
public bool IsPointerOverUi()
Copied!

Key And Value Store

SaveKeyAndValue

Store temporary data locally
Param
Description
_projectName
Use ProjectName+Key storage to prevent Key from being occupied
_key
Unique Name
_value
Data tha nedds to be saved
1
public void SaveKeyAndValue(string _projectName, string _key, string _value)
Copied!

GetValueByKey

Read data temporarily stored on the device
Param
Description
_projectName
Use ProjectName+Key storage to prevent Key from being occupied
_key
Unique name
Return: The data queried
1
public string GetValueByKey(string _projectName, string _key)
Copied!

RemoveKeyAndValue

Removes data and index fields that are temporarily stored locally
Param
Description
_key
Unique name
_key should be projectname+key.
1
public void RemoveKeyAndValue(string _key)
Copied!

Asset loader

LoadGameObject

Load a game object from package by project name
Param
Type
Description
_projectName
String
your project name
_wannaLoadedAssetName
String
you wanna load asset name
_loadedCallback
Action<GameObject>
call back when loaded
1
public void LoadGameObject(string _projectName, string _wannaLoadedAssetName,Action<GameObject> _loadedCallback)
Copied!

LoadTexture2D

Load a Texture2D from package by project name
Param
Type
Description
_projectName
String
your project name
_wannaLoadedAssetName
String
you wanna load asset name
_loadedCallback
Action<Texture2D>
call back when loaded
1
public void LoadTexture2D(string _projectName, string _wannaLoadedAssetName,Action<Texture2D> _loadedCallback)
Copied!

LoadSpriteAtlas

load a Sprite atlas from package by project name
Param
Type
Description
_projectName
String
your project name
_wannaLoadedAssetName
String
you wanna load asset name
_loadedCallback
Action<SpriteAtlas>
call back when loaded
1
public void LoadSpriteAtlas(string _projectName, string _wannaLoadedAssetName,Action<SpriteAtlas> _loadedCallback)
Copied!

LoadAudioClip

Load a Audio clip from package by project name
Param
Type
Description
_projectName
String
your project name
_wannaLoadedAssetName
String
you wanna load asset name
_loadedCallback
Action<AudioClip>
call back when loaded
1
public void LoadAudioClip(string _projectName, string _wannaLoadedAssetName,Action<AudioClip> _loadedCallback)
Copied!

LoadVideoClip

Load a Video clip from package by project name
Param
Type
Description
_projectName
String
your project name
_wannaLoadedAssetName
String
you wanna load asset name
_loadedCallback
Action<VideoClip>
call back when loaded
1
public void LoadVideoClip(string _projectName, string _wannaLoadedAssetName,Action<VideoClip> _loadedCallback)
Copied!

LoadTextAsset

Load a Text assets from package by project name
Param
Type
Description
_projectName
String
your project name
_wannaLoadedAssetName
String
you wanna load asset name
_loadedCallback
Action<TextAsset>
call back when loaded
1
public void LoadTextAsset(string _projectName, string _wannaLoadedAssetName,Action<TextAsset> _loadedCallback)
Copied!

LoadMaterial

Load a Material assets from package by project name
Param
Type
Description
_projectName
String
your project name
_wannaLoadedAssetName
String
you wanna load asset name
_loadedCallback
Action<Material>
call back when loaded
1
public void LoadMaterial(string _projectName, string _wannaLoadedAssetName,Action<Material> _loadedCallback)
Copied!

LoadAsset<T>

Load a unity asset from our package by project name and wanna load asset name.
Param
Type
Description
T
T
UnityObject Type
_projectName
String
your project name
_wannaLoadedAssetName
String
you wanna load asset name
_loadedCallback
Action<T>
call back when loaded
1
public void LoadAsset<T>(string _projectName, string _wannaLoadedAssetName,Action<T> _loadedCallback)
Copied!

LoadAssetAsync<T>(Deprecated)

Asynchronously load a single asset from our package through the project name, and hope to load the asset name.
Return: Your asset of T type
Param
Type
Description
T
T
UnityObject Type
_projectName
String
your project name
_wannaLoadedAssetName
String
you wanna load asset name
1
public async Task<T> LoadAssetAsync<T>(string _projectName, string _wannaLoadedAssetName)
Copied!

GameObject

FindGameObjectByName

Find the object by the name of the GameObject (hash storage is very fast)
Param
Type
Description
_name
GameObject
Object's name
Return: GameObject found
1
public GameObject FindGameObjectByName(string _name)
Copied!

SetVisible

Set the rendering status of the specified GameObject object
Param
Type
Description
_target
GameObject
Specified game object
_visible
Boolean
Visible state;True:Display,False:Hide
1
public void SetVisible(GameObject _target, bool _visible)
Copied!

GetVisible

Get the rendering status of the specified object
Param
Type
Description
_target
GameObject
Specified game object
Return:Rendering status;True:Rendering,False:Hide
1
public bool GetVisible(GameObject _target)
Copied!

InstanceGameObject

Instantiate the prefab and store its instantiated object in the memory in the form of a hash.
Param
Type
Description
_prefab
GameObject
Specified game object
_uniqueName
String
Instantiated object's name
_position
Vector3
Instantiated object's position
_quaternion
Quaternion
instantiated object's rotation
Return:instantiated object
1
public GameObject InstanceGameObject(GameObject _prefab, string _uniqueName, Vector3 _position,Quaternion _quaternion)
Copied!
Param
Type
Description
_prefab
GameObject
Specified game object
_uniqueName
String
Instantiated object's name
_parent
Transform
Instantiated object's parent node
Return:instantiated object
1
public GameObject InstanceGameObject(GameObject _prefab, string _uniqueName, Transform _parent)
Copied!

Device

GetDeviceInfo

Get the device's info
Return:devices info-Json
1
public string GetDeviceInfo()
Copied!

GetSystemLanguage

Acquire system language
Return:system language
1
public string GetSystemLanguage()
Copied!

SetScreenOrientation

set up the screen orientation
Param
Type
Description
_orientation
ScreenOrientation
Screen orientation
1
public void SetScreenOrientation(ScreenOrientation _orientation)
Copied!

AR

TryAcquireSDKVersion

Get current sdk version
Return: SDK version string[e.g. 0.0.1]
1
public string TryAcquireSDKVersion()
Copied!

SetFocusAlgorithmState

Turn on and off the Focus algorithm
Param
Type
Description
_state
bool
True:Turn on,False:Turn off
1
public void SetFocusAlgorithmState(bool _state)
Copied!

StickObject

Place the virtual object into the world
Param
Type
Description
_anchorNotification
Data sent to the anchor manager
1
public void StickObject(AnchorNotificationData _anchorNotification)
Copied!

ExitAR

Exit the AR
1
public void ExitAR()
Copied!

GetCurrentFrame

Get current AR frame
Return: Get current screen frame.
It maybe null, plz attention.
1
public Texture2D GetCurrentFrame()
Copied!

OpenBuiltInBrowser

Use the built-in browser of the app to open the url
Param
Type
Description
_data
Data sent to the built-in browser
1
public void OpenBuiltInBrowser(OpenBuiltInNotificationData _data)
Copied!

TryAcquireAppInfo

Try Acquire App Info
Param
Type
Description
_data
Try acquire operation type
Return: List result
1
public List<object> TryAcquireAppInfo(TryAcquireAppInfoNotificationData _data)
Copied!

ChangeARAlgorithmLife

Addition AR algorithm, It will allow multiple algorithms to be mixed.
Param
Type
Description
_data
The AR life controller data
1
public void ChangeARAlgorithmLife(ARAlgorithmNotificationData _data)
Copied!

TryAcquireCurrentFrame

Get current AR frame
Return: A texture of current frame
It maybe null, plz attention
1
public Texture2D TryAcquireCurrentFrame()
Copied!

TryAcquireLightEstimateValue

Get light estimate value
Return: A light of unity
It maybe null, plz attention
1
public Light TryAcquireLightEstimateValue()
Copied!

CheckARAvailablility

Check whether the current device supports ARKit or ARCore
Return: True:Supports,False:otherwise
1
public bool CheckARAvailability()
Copied!

CheckFeatureAvailability

Check AR features are support on current device
Return: True:Supports,False:otherwise
1
public bool CheckFeatureAvailability(string _featureName)
Copied!
Feature Name
SimpleAR
ImageTracking
Anchors
CpuImages
EnvironmentProbes
ARCollaborationData
ARKitCoachingOverlay
ObjectTracking
FaceTracking
BodyTracking
BasicLightEstimation
HDRLightEstimation
PlaneClassification
Meshing
Depth
ThermalState
Last modified 6mo ago