Doloro GDK 22 .1.0 Beta
by Tauri Interactive
|
The Doloro UI Engine II's module that provides event forwarding features. That module could be useful in case if you need to bind standalone UI elements to virtual events network.
Has compatibility with the Workspaces features.
Works in virtual chained hierarchies provided with layout bonds in auto way. So, the network would consider all chained element as solid hierarchy.
Explore API:
VirtualUIHub
component (or component derived from it) on some GameObject
that you consider as network root.UIHubEventRelay
(or component derived from it) on child object with AGUIElement
that should forward its events to another network connected elements. Select events that will be shared to the hub
.UIHubListener
(or component derived from it) on an object that is a virtual (supplied with the VirtualHierarchyLinker
) or actual child of the VirtualUIHub
hosting game object from the first step.UIHubListener.SetEventHandler(string, VirtualUIHub.SharedEvent)
or on of predefined by API events.UIHubListener.ReleaseEventHanler(string, VirtualUIHub.SharedEvent)
as soon as it's unnecessary.You could define AHubAgent.hub
manually. Using this you could connect some AGUIElement
outside of virtual hierarchy chain to the network.
Note that by default all the placed handlers up to the moment will be released. To prevent this, you have to set UIHubListener.DropHandlerWithHub
property to false.
You could implement your own logic with defining a custom OnHubPreChange
and OnHubPostChange
handler at your custom AHubAgent
.
As has been mentioned above you could set handler to network with not predefined API by using UIHubListener.SetEventHandler(string, VirtualUIHub.SharedEvent)
method.
UIHubListener.SetEventHandler(string, VirtualUIHub.SharedEvent)
by using custom eventCode
.UIHubEventRelay
derived component to the AGUIElement
that will share the custom event. When event occurs call UIHubEventRelay.hub.ShareEvent(this, YOUR_EVENT_CODE, ARGS_ARRAY)
at the re-translator instance and it will share it to each network's UIHubListener
with a handler subscribed of YOUR_EVENT_CODE
.Create a new class derived from abstract AHubAgent
or from a class derived from it. It will provide you integration with virtual hierarchy hub.
In the created hub you may implement your own logic according with component proposes.
Look on UIHubListener
and UIHubEventRelay
implementation as on AHubAgent
example.