cohtml.CohtmlPluginManager
Manage Cohtml Plugin MonoBehaviour events and ensure they are invoked at the appropriate moments. The instance of the object should be unique for the entire lifespan of the application.
Inherits from MonoBehaviour
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| CohtmlPluginManager | GetOrInitInstance() If there is no reference, it creates one, or returns the existing instance of the scene if one already exists. |
| void | RunOnMainThread(Action action) Ensures that the specified action is executed on the main thread. If the caller is already on the main thread, the action is invoked immediately. Otherwise, it is posted to the main thread’s synchronization context for execution. |
| virtual void | Awake() Initializes the main Unity plugin instance and sets up the synchronization context for main-thread operations. |
| void | Reset() Resets the component state and destroys redundant instances if this is not the primary singleton. |
| void | OnDestroy() Stops coroutines and clears the singleton reference. |
Protected Functions
Section titled “Protected Functions”| Name | |
|---|---|
| virtual void | OnGUI() Triggers backend end frame rendering during Repaint. |
| virtual void | OnApplicationQuit() Performs cleanup of Cohtml library and plugin instance. |
Public Properties
Section titled “Public Properties”| Name | |
|---|---|
| CohtmlPluginManager | Instance The singleton instance of the PluginManager component. Monitor whether this component is the only one in the entire lifetime of the application. If an additional component is created, make sure it is destroyed to avoid duplicates. |
Public Attributes
Section titled “Public Attributes”| Name | |
|---|---|
| const string | CohtmlPluginManagerObjectName |
Public Functions Documentation
Section titled “Public Functions Documentation”function GetOrInitInstance
Section titled “function GetOrInitInstance”static CohtmlPluginManager GetOrInitInstance()If there is no reference, it creates one, or returns the existing instance of the scene if one already exists.
Return: The reference to the instance that was found or created
function RunOnMainThread
Section titled “function RunOnMainThread”static void RunOnMainThread( Action action)Ensures that the specified action is executed on the main thread. If the caller is already on the main thread, the action is invoked immediately. Otherwise, it is posted to the main thread’s synchronization context for execution.
Parameters:
- action The action to execute on the main thread.
function Awake
Section titled “function Awake”virtual void Awake()Initializes the main Unity plugin instance and sets up the synchronization context for main-thread operations.
function Reset
Section titled “function Reset”void Reset()Resets the component state and destroys redundant instances if this is not the primary singleton.
function OnDestroy
Section titled “function OnDestroy”void OnDestroy()Stops coroutines and clears the singleton reference.
Protected Functions Documentation
Section titled “Protected Functions Documentation”function OnGUI
Section titled “function OnGUI”virtual void OnGUI()Triggers backend end frame rendering during Repaint.
function OnApplicationQuit
Section titled “function OnApplicationQuit”virtual void OnApplicationQuit()Performs cleanup of Cohtml library and plugin instance.
Public Property Documentation
Section titled “Public Property Documentation”property Instance
Section titled “property Instance”static CohtmlPluginManager Instance;The singleton instance of the PluginManager component. Monitor whether this component is the only one in the entire lifetime of the application. If an additional component is created, make sure it is destroyed to avoid duplicates.
Public Attributes Documentation
Section titled “Public Attributes Documentation”variable CohtmlPluginManagerObjectName
Section titled “variable CohtmlPluginManagerObjectName”const string CohtmlPluginManagerObjectName = "CohtmlPluginManager";© 2026 Coherent Labs. All rights reserved.