cohtml.CohtmlUISystem
A component allowing you to create CohtmlView components and control their behavior.
Inherits from MonoBehaviour
Public Events
Section titled “Public Events”| Name | |
|---|---|
| Action< IUISystem > | OnNativeSystemCreated() Fired immediately after the native IUISystem is created. |
Public Functions
Section titled “Public Functions”| Name | |
|---|---|
| View | CreateView(ViewSettings settings) Creates a native View object with the given settings. |
| void | CreateNativeUISystem(CohtmlSystemSettings systemSettings) Creates the native equivalent of the CohtmlUISystem component. |
| CohtmlUISystem | GetUISystem(bool forceCreate =false) Returns a System object found in the scene. If no System object is found it will create one and return it. |
Protected Functions
Section titled “Protected Functions”| Name | |
|---|---|
| virtual void | Awake() |
| virtual void | Start() |
| virtual void | Update() |
| virtual void | OnRenderObject() |
| virtual void | OnDestroy() When destroying Cohtml components, it must follow a specific order - firstly Views then Systems then Library. Each component is responsible for destroying the component attached before it. For example, the System destroys the attached Views. Each component should first destroy its native Cohtml reference. Each component should first destroy its rendering, if it exists. Each component should also destroy all referenced components attached and depends to it. For example, the DefaultSystem destroys the TextInputHandler. |
Public Properties
Section titled “Public Properties”| Name | |
|---|---|
| IUISystem | SystemNative Returns the native object of the CohtmlUISystem. |
| uint | Id Id of registered UISystem reference in Cohtml native library. |
| UserImagesManager | UserImagesManager Returns the instance of the UserImageManger. |
| CohtmlSystemSettings | Settings Returns the settings used to create the CohtmlUISystem. |
Public Attributes
Section titled “Public Attributes”| Name | |
|---|---|
| const string | CohtmlDefaultUISystemName The name of the default CohtmlUISystem. |
| Func< CohtmlSystemSettings, CohtmlSystemSettings > | OnSystemCreate Change the CohtmlSystemSettings component’s values programmatically upon subscription, just before the system is created with these settings in Native Cohtml. |
| IResourceHandler | ResourceHandler Gets the resource handler. |
| ILocalizationManager | LocalizationManager Gets the localization manager. |
| bool | IsReady Determines whether this instance is ready. |
| ReadOnlyCollection< CohtmlView > | UIViews Returns a List with the view components that belong to the UI system. |
| string | DataPath Returns the path to the game data folder on the target device. |
| string | StreamingAssetsPath Returns the path to the StreamingAssets folder. |
| List< CohtmlUISystem > | CreatedSystems |
Public Events Documentation
Section titled “Public Events Documentation”event OnNativeSystemCreated
Section titled “event OnNativeSystemCreated”Action< IUISystem > OnNativeSystemCreated()Fired immediately after the native IUISystem is created.
Public Functions Documentation
Section titled “Public Functions Documentation”function CreateView
Section titled “function CreateView”View CreateView( ViewSettings settings)Creates a native View object with the given settings.
Parameters:
- settings The setting used to create the View.
Return: Returns the native View object.
function CreateNativeUISystem
Section titled “function CreateNativeUISystem”void CreateNativeUISystem( CohtmlSystemSettings systemSettings)Creates the native equivalent of the CohtmlUISystem component.
Parameters:
- systemSettings The settings used to create the native object.
function GetUISystem
Section titled “function GetUISystem”static CohtmlUISystem GetUISystem( bool forceCreate =false)Returns a System object found in the scene. If no System object is found it will create one and return it.
Parameters:
- forceCreate Forces the creation of a game object with a System component if such doesn’t exist in the scene.
Exceptions:
- SystemException When more than one system exists on the scene, it is unclear which system should be returned as a result to the caller. To avoid this exception, you should always reference the System in relation to CohtmlView, which requires a system for its creation.
Return: Found System or null when have multiple systems.
When multiple systems are found on the current scene, it returns null, as it is undefined which system the caller intends to reference with this method.
Protected Functions Documentation
Section titled “Protected Functions Documentation”function Awake
Section titled “function Awake”virtual void Awake()function Start
Section titled “function Start”virtual void Start()function Update
Section titled “function Update”virtual void Update()function OnRenderObject
Section titled “function OnRenderObject”virtual void OnRenderObject()function OnDestroy
Section titled “function OnDestroy”virtual void OnDestroy()When destroying Cohtml components, it must follow a specific order - firstly Views then Systems then Library. Each component is responsible for destroying the component attached before it. For example, the System destroys the attached Views. Each component should first destroy its native Cohtml reference. Each component should first destroy its rendering, if it exists. Each component should also destroy all referenced components attached and depends to it. For example, the DefaultSystem destroys the TextInputHandler.
Public Property Documentation
Section titled “Public Property Documentation”property SystemNative
Section titled “property SystemNative”IUISystem SystemNative;Returns the native object of the CohtmlUISystem.
property Id
Section titled “property Id”uint Id;Id of registered UISystem reference in Cohtml native library.
property UserImagesManager
Section titled “property UserImagesManager”UserImagesManager UserImagesManager;Returns the instance of the UserImageManger.
property Settings
Section titled “property Settings”CohtmlSystemSettings Settings;Returns the settings used to create the CohtmlUISystem.
Public Attributes Documentation
Section titled “Public Attributes Documentation”variable CohtmlDefaultUISystemName
Section titled “variable CohtmlDefaultUISystemName”const string CohtmlDefaultUISystemName = "CohtmlDefaultUISystem";The name of the default CohtmlUISystem.
variable OnSystemCreate
Section titled “variable OnSystemCreate”Func< CohtmlSystemSettings, CohtmlSystemSettings > OnSystemCreate;Change the CohtmlSystemSettings component’s values programmatically upon subscription, just before the system is created with these settings in Native Cohtml.
variable ResourceHandler
Section titled “variable ResourceHandler”IResourceHandler ResourceHandler => Settings.ResourceHandler;Gets the resource handler.
The resource handler.
variable LocalizationManager
Section titled “variable LocalizationManager”ILocalizationManager LocalizationManager => Settings.LocalizationManager;Gets the localization manager.
The localization manager.
variable IsReady
Section titled “variable IsReady”bool IsReady => SystemNative != null;Determines whether this instance is ready.
Return: true if this instance is ready; otherwise, false.
variable UIViews
Section titled “variable UIViews”ReadOnlyCollection< CohtmlView > UIViews => m_Views.AsReadOnly();Returns a List with the view components that belong to the UI system.
List with CohtmlView components.
variable DataPath
Section titled “variable DataPath”static string DataPath => Application.dataPath;Returns the path to the game data folder on the target device.
variable StreamingAssetsPath
Section titled “variable StreamingAssetsPath”static string StreamingAssetsPath => Application.streamingAssetsPath;Returns the path to the StreamingAssets folder.
variable CreatedSystems
Section titled “variable CreatedSystems”static List< CohtmlUISystem > CreatedSystems = new List<CohtmlUISystem>();© 2026 Coherent Labs. All rights reserved.