Skip to content
SiteEmail

cohtml.CohtmlUISystem

A component allowing you to create CohtmlView components and control their behavior.

Inherits from MonoBehaviour

Name
Action< IUISystem >OnNativeSystemCreated()
Fired immediately after the native IUISystem is created.
Name
ViewCreateView(ViewSettings settings)
Creates a native View object with the given settings.
voidCreateNativeUISystem(CohtmlSystemSettings systemSettings)
Creates the native equivalent of the CohtmlUISystem component.
CohtmlUISystemGetUISystem(bool forceCreate =false)
Returns a System object found in the scene. If no System object is found it will create one and return it.
Name
virtual voidAwake()
virtual voidStart()
virtual voidUpdate()
virtual voidOnRenderObject()
virtual voidOnDestroy()
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.
Name
IUISystemSystemNative
Returns the native object of the CohtmlUISystem.
uintId
Id of registered UISystem reference in Cohtml native library.
UserImagesManagerUserImagesManager
Returns the instance of the UserImageManger.
CohtmlSystemSettingsSettings
Returns the settings used to create the CohtmlUISystem.
Name
const stringCohtmlDefaultUISystemName
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.
IResourceHandlerResourceHandler
Gets the resource handler.
ILocalizationManagerLocalizationManager
Gets the localization manager.
boolIsReady
Determines whether this instance is ready.
ReadOnlyCollection< CohtmlView >UIViews
Returns a List with the view components that belong to the UI system.
stringDataPath
Returns the path to the game data folder on the target device.
stringStreamingAssetsPath
Returns the path to the StreamingAssets folder.
List< CohtmlUISystem >CreatedSystems
Action< IUISystem > OnNativeSystemCreated()

Fired immediately after the native IUISystem is created.

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.

void CreateNativeUISystem(
CohtmlSystemSettings systemSettings
)

Creates the native equivalent of the CohtmlUISystem component.

Parameters:

  • systemSettings The settings used to create the native object.
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.

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.

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.

const string CohtmlDefaultUISystemName = "CohtmlDefaultUISystem";

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 => Settings.ResourceHandler;

Gets the resource handler.

The resource handler.

ILocalizationManager LocalizationManager => Settings.LocalizationManager;

Gets the localization manager.

The localization manager.

bool IsReady => SystemNative != null;

Determines whether this instance is ready.

Return: true if this instance is ready; otherwise, false.

ReadOnlyCollection< CohtmlView > UIViews => m_Views.AsReadOnly();

Returns a List with the view components that belong to the UI system.

List with CohtmlView components.

static string DataPath => Application.dataPath;

Returns the path to the game data folder on the target device.

static string StreamingAssetsPath => Application.streamingAssetsPath;

Returns the path to the StreamingAssets folder.

static List< CohtmlUISystem > CreatedSystems = new List<CohtmlUISystem>();