UI Controller
Presented by IUIController interface, this system provides pretty wide range of functionality which help to handle different game UI parts, display message boxes, dialogs, etc.
To use this system, inject IUIController interface into your class, as shown below:
Parameters in inspector
currencySlotPrefab – prefab of UI currency slot.
currenciesHolder – transform inside the UI canvas, which contains currency slots.
levelLabel – text label which indicates current player's level.
expBar – player experience bar.
Available methods
Message Boxes
This method shows message box with certain title and message. It also pauses the game, if pauseGame flag set to true.
Example:
This method shows message box with certain title, message and buttonText on button. It also pauses the game, if pauseGame flag set to true. Also, buttonCallback is invoked if user clicks message box button.
Example:
This method shows message box with certain title, message and buttons described by buttons parameters array.
Example:
Dialogs
This method shows dialog with message, certain dialogPopupMode and avatarSprite (which visually represents character who says that message to player). Dialog appears in amount of time set by appearanceTime parameter and invokes closeCallback right after dialog closing.
Example:
This method shows dialog with message, certain dialogPopupMode and targetTransform (camera will be targeted to this transform from targetDistance). Dialog appears in amount of time set by appearanceTime parameter and invokes closeCallback right after dialog closing.
Example:
This method shows dialog with message, certain dialogPopupMode and avatarSprite (which visually represents character who says that message to player). Dialog appears in amount of time set by appearanceTime parameter, plays certain sound and invokes closeCallback right after dialog closing.
This method could be useful if you need to accompany text message with its voice representation.
Last updated