Skip to content
SiteEmail

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

Name
CohtmlPluginManagerGetOrInitInstance()
If there is no reference, it creates one, or returns the existing instance of the scene if one already exists.
voidRunOnMainThread(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 voidAwake()
Initializes the main Unity plugin instance and sets up the synchronization context for main-thread operations.
voidReset()
Resets the component state and destroys redundant instances if this is not the primary singleton.
voidOnDestroy()
Stops coroutines and clears the singleton reference.
Name
virtual voidOnGUI()
Triggers backend end frame rendering during Repaint.
virtual voidOnApplicationQuit()
Performs cleanup of Cohtml library and plugin instance.
Name
CohtmlPluginManagerInstance
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.
Name
const stringCohtmlPluginManagerObjectName
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

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.
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.

virtual void OnGUI()

Triggers backend end frame rendering during Repaint.

virtual void OnApplicationQuit()

Performs cleanup of Cohtml library and plugin 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.

const string CohtmlPluginManagerObjectName = "CohtmlPluginManager";