Utility API

UGUI

IsPointerOverUi

Description

It is used to determine whether ugui objects are touched. Prevent raycast ray penetration when clicking ugui objects.

Return

Bool 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

Description

Store temporary data locally

Parmaters

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

Description

Read data temporarily stored on the device

Return

String The data queried

Parameters

Param
Description
_projectName
Use ProjectName+Key storage to prevent Key from being occupied
_key
Unique name
1
public string GetValueByKey(string _projectName, string _key)
Copied!

RemoveKeyAndValue

Description

Removes data and index fields that are temporarily stored locally

Parameters

Param
Description
_key
Unique name
_key should be projectname+key.
1
public void RemoveKeyAndValue(string _key)
Copied!

Runtime Tag

GetGameObjectByTag

Description

Finding the gameObject by tag

Parameters

Param
Type
Description
_tag
String
Unique name
_gameObject
GameObject(out)
The search result
1
public void GetGameObjectByTag(string _tag,GameObject _gameObject)
Copied!

DoCompareTag

Description

Compare whether two tags are consistent

Parameters

Param
Type
Description
_tag
String
Unique name
1
public void DoCompareTag(string _tag)
Copied!

Asset loader

LoadAsset<T>

Description

Load a unity asset from our package by project name and wanna load asset name.

Parameters

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>

Description

Asynchronously load a single asset from our package through the project name, and hope to load the asset name.

Return

Object Your asset of T type

Parameters

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!

Device

GetDeviceInfo

Description

Get the device's info

Return

String devices info-Json
1
public string GetDeviceInfo()
Copied!

GetSystemLanguage

Description

Acquire system language

Return

String system language
1
public string GetSystemLanguage()
Copied!

SetScreenOrientation

Description

set up the screen orientation

Parameters

Param
Type
Description
_orientation
ScreenOrientation
Screen orientation
1
public void SetScreenOrientation(ScreenOrientation _orientation)
Copied!

Last modified 12d ago