Skip to content
SiteEmail

cohtml.Net.UnityPlugin

Establish the connection between Unity3D integration and the Native Cohtml SDK.

Inherits from SystemIDisposable

Name
enum classEventTypes { UET_DrawView = 1, UET_SetRenderTarget = 2, UET_CreateSystemRenderer = 3, UET_CreateViewRenderer = 4, UET_DestroySystemRenderer = 5, UET_DestroyViewRenderer = 6, UET_BackendBeginFrame = 7, UET_BackendEndFrame = 8}
enum classRenoirRenderingEvent { RRE_InitializeRenderingResources = 1, RRE_DestroyRenderingResources = 2, RRE_ExecuteCaptureBuffer = 3, RRE_BeginFrame = 4, RRE_EndFrame = 5}
Name
virtual voidDispose()
boolEnsureRenoirLibrary(LibraryParams arg0)
Creates a rendering for the library and checks if it is running and available for use.
voidSetRenderTextureData(global.System.IntPtr viewTexturePtr, global.System.IntPtr globalBackdropPtr, uint width, uint height, uint antialiasingLevel, uint wideTexture)
Registering a render texture with specific settings, which will be used for drawing the UI displayed by a designated CohtmlView.
voidSetUserBackground(uint systemId, uint viewId, global.System.IntPtr texturePtr, uint width, uint height, int format, uint flipY)
The background where the UI scene will be drawn.
voidProcessResources()
Update the processes of a given system, which includes sending log messages from Cohtml, announcing the deletion of cached textures, and destroying pending Views and Systems objects.
voidOnEditorQuit()
Deinitialization of Cohtml Native objects begins upon exiting the Unity3D Editor.
voidDestroySystems()
Destroy all systems, ensuring the destruction of all associated objects before proceeding.
voidOnApplicationQuit()
Initiating the completion of internal processes in the Native Cohtml SDK, which are mandatory when shutting down the Unity3D application.
voidUnityRenderEvent(int eventID)
Registers events to be executed on the application’s render thread.
voidSetShouldUseCSharpBackend(bool shouldUse)
Will make the plugin to switch from Native rendering backend to Unity3D CSharp rendering backend which uses Unity’s rendering API.
voidSetLibraryMultithreadAwareness(bool enable)
Reserved method for internal usage. Do not use.
voidSetActiveColorSpace(int colorSpace)
uintGetAllocationCount()
uintGetAllocatedMemory()
uintGetTotalAllocations()
uintGetTotalsByType(MemTagsType memtag)
uintGetCurrentBytesByType(MemTagsType memtag)
uintGetCurrentCountsByType(MemTagsType memtag)
ulongGetTimeSpentInAllocationsNs()
voidEnableMemoryTracking(bool enable)
Enables extracting detailed information about the allocated GPU memory in the Library.
Name
UnityPluginInstance
The singleton instance of the UnityPlugin.
Name
UnityPlugins_Instance
Name
boolswigCMemOwn
EnumeratorValueDescription
UET_DrawView1
UET_SetRenderTarget2
UET_CreateSystemRenderer3
UET_CreateViewRenderer4
UET_DestroySystemRenderer5
UET_DestroyViewRenderer6
UET_BackendBeginFrame7
UET_BackendEndFrame8
EnumeratorValueDescription
RRE_InitializeRenderingResources1
RRE_DestroyRenderingResources2
RRE_ExecuteCaptureBuffer3
RRE_BeginFrame4
RRE_EndFrame5
virtual void Dispose()
bool EnsureRenoirLibrary(
LibraryParams arg0
)

Creates a rendering for the library and checks if it is running and available for use.

void SetRenderTextureData(
global.System.IntPtr viewTexturePtr,
global.System.IntPtr globalBackdropPtr,
uint width,
uint height,
uint antialiasingLevel,
uint wideTexture
)

Registering a render texture with specific settings, which will be used for drawing the UI displayed by a designated CohtmlView.

Parameters:

  • viewTexturePtr Pointer of the view rendering texture reference created by Unity3D engine.
  • globalBackdropPtr Pointer of the View’s global backdrop filter texture reference created by Unity3D engine.
  • width The width of the texture.
  • height The height of the texture.
  • antialiasingLevel The antialiasing level determines the count of the samples.
  • wideTexture Determines whether the texture is a Wide Texture.
void SetUserBackground(
uint systemId,
uint viewId,
global.System.IntPtr texturePtr,
uint width,
uint height,
int format,
uint flipY
)

The background where the UI scene will be drawn.

Parameters:

  • systemId ID of the system that stores this image.
  • viewId ID of the View that stores this image.
  • texturePtr Pointer to a user-defined representation of the texture. Will be passed as-is to the graphics backend.
  • width The width of the texture.
  • height The height of the texture.
  • format Pixel format of the texture.
  • flipY Determines the origin of the texture is flipped by Y rotation.
void ProcessResources()

Update the processes of a given system, which includes sending log messages from Cohtml, announcing the deletion of cached textures, and destroying pending Views and Systems objects.

void OnEditorQuit()

Deinitialization of Cohtml Native objects begins upon exiting the Unity3D Editor.

void DestroySystems()

Destroy all systems, ensuring the destruction of all associated objects before proceeding.

void OnApplicationQuit()

Initiating the completion of internal processes in the Native Cohtml SDK, which are mandatory when shutting down the Unity3D application.

void UnityRenderEvent(
int eventID
)

Registers events to be executed on the application’s render thread.

Parameters:

  • eventID is a composite binary number that contains information about the event type, the ID of the system to which the event is addressed, and the ID of the view to which the event is directed.
void SetShouldUseCSharpBackend(
bool shouldUse
)

Will make the plugin to switch from Native rendering backend to Unity3D CSharp rendering backend which uses Unity’s rendering API.

Parameters:

  • shouldUse boolean determine to enable the CSharp rendering backend.
void SetLibraryMultithreadAwareness(
bool enable
)

Reserved method for internal usage. Do not use.

void SetActiveColorSpace(
int colorSpace
)
uint GetAllocationCount()
uint GetAllocatedMemory()
uint GetTotalAllocations()
uint GetTotalsByType(
MemTagsType memtag
)
uint GetCurrentBytesByType(
MemTagsType memtag
)
uint GetCurrentCountsByType(
MemTagsType memtag
)
ulong GetTimeSpentInAllocationsNs()
static void EnableMemoryTracking(
bool enable
)

Enables extracting detailed information about the allocated GPU memory in the Library.

Parameters:

  • enable True to enable and false to disable the feature.
static UnityPlugin Instance;

The singleton instance of the UnityPlugin.

static UnityPlugin s_Instance;
bool swigCMemOwn;