Runtime UI Setup
Last updated
Last updated
Please also have a look at the demo scene. The RuntimeProgressTest class assigned to the _DEMO gameObject in the demo scene handles all important aspects, like starting a research and listening to events.
The runtime setup of a Progress Graph consists of three components:
Progress Controller (In the scene) Controls the loading of a graph, as well as starting a research
Progress Graph UI Controller (In the scene) Builds the actual graph
Progress Node UI Element The actual UI Node. Handles UI Interaction and starts a new research on mouse click.
You can of course create your own ProgressGraphUIController if you like to build your graph differently. Simply make sure to implement the IProgressGraphUIControl interface to your custom class and assign the GameObject which has the custom class to the ProgressController ProgressUIControl field in the inspector.
The ProgressController contains multiple methods which allows you to control a Progress Graph like starting a research or listening to specific events. Make sure to have a reference to the ProgressController script to control your graph. Please have a look at the API section to see all available methods and events.
ProgressControllerProgress Graph: The assigned Progress Graph (can be switched at runtime)
Progress UI Control: The GameObject which controls the actual Progress Graph UI. Must implement the IProgressGraphUIControl interface.
Load On Start: If true, the graph will be loaded directly on start.