cohtml.UserImagesManager

A class that stores and manages preloaded and live view images.

Inherits from cohtml.IPreloadTextureHandable

Public Functions

Name
UserImagesManager(CohtmlUISystem system)
Constructor taking the CohtmlUISystem component which will own the preloaded assets.
voidSubscribePreloadedTextureReleased()
Subscribes to an event that is invoked when a preloaded texture was released by Cohtml.
boolAddLiveView(string name, CohtmlLiveView liveViewComponent)
Adds a CohtmlLiveView component.
voidRemoveLiveView(string url)
Removes a CohtmlLiveView component.
voidRemoveLiveViews()
Removes all CohtmlLiveView components.
ResourceResponse.UserImageDataCreateLiveViewImageData(string url)
Creates a native live view image data object for the provided URL.
ResourceResponse.UserImageDataCreateUserImageData(Texture texture, uint imageHandle =0)
Creates a native user image data object for the provided texture.
voidUpdateLiveViews()
Notifies Cohtml that live view resources need to be updated. Should be invoked whenever a change in live view resources occurs.
boolContainsLiveView(string uri)
Returns true if a live view exists with the given resource identifier.
voidAddPreloadedTexture(IntPtr texturePtr, Texture texture)
Adds a preloaded texture to a dictionary collection at the given key.
TextureGetPreloadedTexture(IntPtr texturePtr)
Returns a preloaded texture or null if it doesn’t exist.
boolReleasePreloadedTexture(IntPtr texturePtr)
Releases a preloaded texture from memory.
voidReleaseAllPreloadedTextures()
Releases all preloaded textures from memory.
voidDispose()

Public Properties

Name
Dictionary< IntPtr, Texture >PreloadedTextures
A collection storing preloaded images.

Public Functions Documentation

function UserImagesManager

UserImagesManager(
    CohtmlUISystem system
)

Constructor taking the CohtmlUISystem component which will own the preloaded assets.

function SubscribePreloadedTextureReleased

void SubscribePreloadedTextureReleased()

Subscribes to an event that is invoked when a preloaded texture was released by Cohtml.

function AddLiveView

bool AddLiveView(
    string name,
    CohtmlLiveView liveViewComponent
)

Adds a CohtmlLiveView component.

function RemoveLiveView

void RemoveLiveView(
    string url
)

Removes a CohtmlLiveView component.

function RemoveLiveViews

void RemoveLiveViews()

Removes all CohtmlLiveView components.

function CreateLiveViewImageData

ResourceResponse.UserImageData CreateLiveViewImageData(
    string url
)

Creates a native live view image data object for the provided URL.

function CreateUserImageData

ResourceResponse.UserImageData CreateUserImageData(
    Texture texture,
    uint imageHandle =0
)

Creates a native user image data object for the provided texture.

function UpdateLiveViews

void UpdateLiveViews()

Notifies Cohtml that live view resources need to be updated. Should be invoked whenever a change in live view resources occurs.

function ContainsLiveView

bool ContainsLiveView(
    string uri
)

Returns true if a live view exists with the given resource identifier.

function AddPreloadedTexture

void AddPreloadedTexture(
    IntPtr texturePtr,
    Texture texture
)

Adds a preloaded texture to a dictionary collection at the given key.

Parameters:

  • texturePtr The pointer that will be used as a key.
  • texture The texture to add.

Reimplements: cohtml.IPreloadTextureHandable.AddPreloadedTexture

function GetPreloadedTexture

Texture GetPreloadedTexture(
    IntPtr texturePtr
)

Returns a preloaded texture or null if it doesn’t exist.

Reimplements: cohtml.IPreloadTextureHandable.GetPreloadedTexture

function ReleasePreloadedTexture

bool ReleasePreloadedTexture(
    IntPtr texturePtr
)

Releases a preloaded texture from memory.

Reimplements: cohtml.IPreloadTextureHandable.ReleasePreloadedTexture

function ReleaseAllPreloadedTextures

void ReleaseAllPreloadedTextures()

Releases all preloaded textures from memory.

function Dispose

void Dispose()

Public Property Documentation

property PreloadedTextures

Dictionary< IntPtr, Texture > PreloadedTextures;

A collection storing preloaded images.