Skip to main content

Auki::ConjureKit::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 ConjureKitModule, Auki.ConjureKit.Odal.IOdal

Public Functions

Name
Odal(IConjureKit conjureKit, int assetsLayer =0)
Constructor - initializes & registers Odal as an AukiModule for a given IConjureKit object.
voidInstantiate(string assetId, Entity entity, Action onComplete, Action< string > onError)
Instantiate an asset to be attached to a given Entity
List< AnimationClip >GetAnimationClips(string assetId)
Gets a list of all AnimationClips attached to a given asset.
voidAnimate(Entity entity, string clipName, AnimationAction actionType =AnimationAction.PLAY, AnimationMode wrapMode =AnimationMode.LOOP)
Run an animation on the asset attached to a given Entity.
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.
voidSetRenderParticipants(bool render)
Sets if the assets attached to other Participants' entities should be visible or not.
override void_Init(Action onComplete, Action< string > onFailed)
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.
override Tuple< uint, uint >_GetMessageTypeRange()
(Internal) Returns the message type range expected by the module.

Public Properties

Name
boolIsReady

Public Attributes

Name
const stringODAL_COMPONENT_TYPE_NAME
This is the type name for the component we use to tag the entity where an asset is present

Public Functions Documentation

function Odal

Odal(
IConjureKit conjureKit,
int assetsLayer =0
)

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

Parameters:

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

function Instantiate

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

Instantiate an asset to be attached to a given Entity

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 Animate

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

Run an animation on the asset attached to a given Entity.

Parameters:

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

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 SetRenderParticipants

void SetRenderParticipants(
bool render
)

Sets if the assets attached to other Participants' entities should be visible or not.

Parameters:

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

function _Init

override void _Init(
Action onComplete,
Action< string > onFailed
)

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 _GetMessageTypeRange

override Tuple< uint, uint > _GetMessageTypeRange()

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

Return: Message type range tuple

Public Property Documentation

property IsReady

bool IsReady;

Public Attributes Documentation

variable ODAL_COMPONENT_TYPE_NAME

static const string ODAL_COMPONENT_TYPE_NAME = "auki.odal.asset";

This is the type name for the component we use to tag the entity where an asset is present