cohtml.Net.UnityPlugin
Establish the connection between Unity3D integration and the Native Cohtml SDK.
Inherits from SystemIDisposable
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
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 texturePtr, global.System.IntPtr bufferPtr, 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. |
void | SetUnityVersion(string str) Send the Unity3D engine version to the Native Cohtml Plugin. |
Public Properties
Name | |
---|---|
UnityPlugin | Instance The singleton instance of the UnityPlugin. |
Public Attributes
Name | |
---|---|
UnityPlugin | s_Instance |
Protected Attributes
Name | |
---|---|
bool | swigCMemOwn |
Public Types Documentation
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
Enumerator | Value | Description |
---|---|---|
RRE_InitializeRenderingResources | 1 | |
RRE_DestroyRenderingResources | 2 | |
RRE_ExecuteCaptureBuffer | 3 | |
RRE_BeginFrame | 4 | |
RRE_EndFrame | 5 |
Public Functions Documentation
function Dispose
virtual void Dispose()
function EnsureRenoirLibrary
bool EnsureRenoirLibrary(
LibraryParams arg0
)
Creates a rendering for the library and checks if it is running and available for use.
function SetRenderTextureData
void SetRenderTextureData(
global.System.IntPtr texturePtr,
global.System.IntPtr bufferPtr,
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:
- texturePtr Pointer of the texture reference created by Unity3D engine.
- bufferPtr Pointer reference used for the buffer depth texture.
- 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
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
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
void OnEditorQuit()
Deinitialization of Cohtml Native objects begins upon exiting the Unity3D Editor.
function DestroySystems
void DestroySystems()
Destroy all systems, ensuring the destruction of all associated objects before proceeding.
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
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
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
void SetLibraryMultithreadAwareness(
bool enable
)
Reserved method for internal usage. Do not use.
function SetActiveColorSpace
void SetActiveColorSpace(
int colorSpace
)
function GetAllocationCount
uint GetAllocationCount()
function GetAllocatedMemory
uint GetAllocatedMemory()
function GetTotalAllocations
uint GetTotalAllocations()
function GetTotalsByType
uint GetTotalsByType(
MemTagsType memtag
)
function GetCurrentBytesByType
uint GetCurrentBytesByType(
MemTagsType memtag
)
function GetCurrentCountsByType
uint GetCurrentCountsByType(
MemTagsType memtag
)
function GetTimeSpentInAllocationsNs
ulong GetTimeSpentInAllocationsNs()
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.
function SetUnityVersion
static void SetUnityVersion(
string str
)
Send the Unity3D engine version to the Native Cohtml Plugin.
Public Property Documentation
property Instance
static UnityPlugin Instance;
The singleton instance of the UnityPlugin.
Public Attributes Documentation
variable s_Instance
static UnityPlugin s_Instance;
Protected Attributes Documentation
variable swigCMemOwn
bool swigCMemOwn;