Skip to main content

Auki::Odal::Odal

Odal module - implements the ability to add an asset tied to an Entity in a Session such that all Participants can download the asset, render/animate or play it synchronously and interoperably agnostic to applications.

Inherits from AukiModule, Auki.Odal.IOdal

Public Functions

Name
GameObjectGetUnmanagedGameObject(uint entityId)
Gets the GameObject of the AssetInstance attached to the Entity.
List< AssetInstance >GetParticipantAssetInstances(uint participantId)
Gets a list of AssetInstances owned by a given Participant.
Odal(IConjureKit conjureKit, Vikja.Vikja vikja, int assetsLayer =0)
Constructor - initializes & registers Odal as an AukiModule for a given IConjureKit object.
override Tuple< uint, uint >_GetMessageTypeRange()
(Internal) Returns the message type range expected by the module.
voidInit(Action onComplete)
Initializes Odal module. ConjureKit must wait until onComplete is invoked before connecting to ensure correct Odal setup.
voidAnimate(Entity entity, string clipName, AnimationMode wrapMode =AnimationMode.LOOP)
Sends a request to run an animation on the asset attached to an Entity.
override void_Update()
(Internal) Game loop per-frame update. Invoked by the IConjureKit-implementing object the module was constructed with.
override void_HandleMessage(uint messageType, byte[] data)
(Internal) Handles a Hagall message. Invoked by the IConjureKit-implementing object the module was constructed with.
voidInstantiate(string assetId, Entity entity, Action< uint > onComplete, Action onError)
Sends a request to instantiate an asset.
List< AnimationClip >GetAnimationClips(string assetId)
Gets a list of all AnimationClips attached to a given asset.
voidSetRenderParticipants(bool render)
Sets if the asset attached to a Participant Entity should be visible or not.

Public Functions Documentation

function GetUnmanagedGameObject

GameObject GetUnmanagedGameObject(
uint entityId
)

Gets the GameObject of the AssetInstance attached to the Entity.

Parameters:

  • entityId Entity id

Return: GameObject of the AssetInstance or null if there is none

function GetParticipantAssetInstances

List< AssetInstance > GetParticipantAssetInstances(
uint participantId
)

Gets a list of AssetInstances owned by a given Participant.

Parameters:

  • participantId Participant id

Return: List of 0 or more AssetInstances owned by the Participant

function Odal

Odal(
IConjureKit conjureKit,
Vikja.Vikja vikja,
int assetsLayer =0
)

Constructor - initializes & registers Odal as an AukiModule for a given IConjureKit object.

Parameters:

  • conjureKit IConjureKit-implementing object
  • vikja Vikja module object
  • assetsLayer Unity layer that will be used for any AssetInstance GameObjects

function _GetMessageTypeRange

override Tuple< uint, uint > _GetMessageTypeRange()

(Internal) Returns the message type range expected by the module.

Return: Message type range tuple

function Init

void Init(
Action onComplete
)

Initializes Odal module. ConjureKit must wait until onComplete is invoked before connecting to ensure correct Odal setup.

Parameters:

  • onComplete Callback when the initialization is complete

function Animate

void Animate(
Entity entity,
string clipName,
AnimationMode wrapMode =AnimationMode.LOOP
)

Sends a request to run an animation on the asset attached to an Entity.

Parameters:

  • entity Entity with attached asset that we want to animate
  • clipName Animation clip name
  • wrapMode Animation wrap mode

function _Update

override void _Update()

(Internal) Game loop per-frame update. Invoked by the IConjureKit-implementing object the module was constructed with.

function _HandleMessage

override void _HandleMessage(
uint messageType,
byte[] data
)

(Internal) Handles a Hagall message. Invoked by the IConjureKit-implementing object the module was constructed with.

Parameters:

  • messageType Message type
  • data Byte array-encoded data

function Instantiate

void Instantiate(
string assetId,
Entity entity,
Action< uint > onComplete,
Action onError
)

Sends a request to instantiate an asset.

Parameters:

  • assetId Asset id
  • entity Entity to which the asset will be attached to
  • onComplete Callback when the Asset has been instantiated with an argument the AssetInstance id
  • onError Callback when the instantiation failed

function GetAnimationClips

List< AnimationClip > GetAnimationClips(
string assetId
)

Gets a list of all AnimationClips attached to a given asset.

Parameters:

  • assetId Asset idr

Return: A list of AnimationClips or null if there are no clips or if the asset for this id was not found

function SetRenderParticipants

void SetRenderParticipants(
bool render
)

Sets if the asset attached to a Participant Entity should be visible or not.

Parameters:

  • render true if the assets should be visible, false if they should be hidden