cohtml.Net.UnityPlugin
Establish the connection between Unity3D integration and the Native Cohtml SDK.
Inherits from SystemIDisposable
Public Types
Section titled “Public Types”| Name | |
|---|---|
| enum class | EventTypes { 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 class | RenoirRenderingEvent { RRE_InitializeRenderingResources = 1, RRE_DestroyRenderingResources = 2, RRE_ExecuteCaptureBuffer = 3, RRE_BeginFrame = 4, RRE_EndFrame = 5} |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| 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. |
| 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. |
| 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. |
| 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. |
| 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() |
| void | EnableMemoryTracking(bool enable) Enables extracting detailed information about the allocated GPU memory in the Library. |
Public Properties
Section titled “Public Properties”| Name | |
|---|---|
| UnityPlugin | Instance The singleton instance of the UnityPlugin. |
Public Attributes
Section titled “Public Attributes”| Name | |
|---|---|
| UnityPlugin | s_Instance |
Protected Attributes
Section titled “Protected Attributes”| Name | |
|---|---|
| bool | swigCMemOwn |
Public Types Documentation
Section titled “Public Types Documentation”enum EventTypes
Section titled “enum EventTypes”| Enumerator | Value | Description |
|---|---|---|
| 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 RenoirRenderingEvent
Section titled “enum RenoirRenderingEvent”| Enumerator | Value | Description |
|---|---|---|
| RRE_InitializeRenderingResources | 1 | |
| RRE_DestroyRenderingResources | 2 | |
| RRE_ExecuteCaptureBuffer | 3 | |
| RRE_BeginFrame | 4 | |
| RRE_EndFrame | 5 |
Public Functions Documentation
Section titled “Public Functions Documentation”function Dispose
Section titled “function Dispose”virtual void Dispose()function EnsureRenoirLibrary
Section titled “function EnsureRenoirLibrary”bool EnsureRenoirLibrary( LibraryParams arg0)Creates a rendering for the library and checks if it is running and available for use.
function SetRenderTextureData
Section titled “function SetRenderTextureData”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.
function SetUserBackground
Section titled “function SetUserBackground”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.
function ProcessResources
Section titled “function ProcessResources”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.
function OnEditorQuit
Section titled “function OnEditorQuit”void OnEditorQuit()Deinitialization of Cohtml Native objects begins upon exiting the Unity3D Editor.
function DestroySystems
Section titled “function DestroySystems”void DestroySystems()Destroy all systems, ensuring the destruction of all associated objects before proceeding.
function OnApplicationQuit
Section titled “function OnApplicationQuit”void OnApplicationQuit()Initiating the completion of internal processes in the Native Cohtml SDK, which are mandatory when shutting down the Unity3D application.
function UnityRenderEvent
Section titled “function UnityRenderEvent”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.
function SetShouldUseCSharpBackend
Section titled “function SetShouldUseCSharpBackend”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.
function SetLibraryMultithreadAwareness
Section titled “function SetLibraryMultithreadAwareness”void SetLibraryMultithreadAwareness( bool enable)Reserved method for internal usage. Do not use.
function SetActiveColorSpace
Section titled “function SetActiveColorSpace”void SetActiveColorSpace( int colorSpace)function GetAllocationCount
Section titled “function GetAllocationCount”uint GetAllocationCount()function GetAllocatedMemory
Section titled “function GetAllocatedMemory”uint GetAllocatedMemory()function GetTotalAllocations
Section titled “function GetTotalAllocations”uint GetTotalAllocations()function GetTotalsByType
Section titled “function GetTotalsByType”uint GetTotalsByType( MemTagsType memtag)function GetCurrentBytesByType
Section titled “function GetCurrentBytesByType”uint GetCurrentBytesByType( MemTagsType memtag)function GetCurrentCountsByType
Section titled “function GetCurrentCountsByType”uint GetCurrentCountsByType( MemTagsType memtag)function GetTimeSpentInAllocationsNs
Section titled “function GetTimeSpentInAllocationsNs”ulong GetTimeSpentInAllocationsNs()function EnableMemoryTracking
Section titled “function EnableMemoryTracking”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.
Public Property Documentation
Section titled “Public Property Documentation”property Instance
Section titled “property Instance”static UnityPlugin Instance;The singleton instance of the UnityPlugin.
Public Attributes Documentation
Section titled “Public Attributes Documentation”variable s_Instance
Section titled “variable s_Instance”static UnityPlugin s_Instance;Protected Attributes Documentation
Section titled “Protected Attributes Documentation”variable swigCMemOwn
Section titled “variable swigCMemOwn”bool swigCMemOwn;© 2026 Coherent Labs. All rights reserved.