Class: GlobalUIManager
- Namespace:
Global - Assembly:
Dew.Core.dll - Inheritance / Derived: LogicBehaviour →
ManagerBase→ GlobalUIManager
public class GlobalUIManager : ManagerBase<GlobalUIManager>, ILogicUpdateFields
| Name | Declaration | Description |
|---|---|---|
currentMenuView | `[NonSerialized] | |
| public IMenuView currentMenuView` | ||
devFloatingTextParent | public RectTransform devFloatingTextParent | |
devFloatingTextPrefab | public TextMeshProUGUI devFloatingTextPrefab | |
focusDisplayAnimationTarget | public Transform focusDisplayAnimationTarget | |
focusDisplayBoxObject | public GameObject focusDisplayBoxObject | |
focusDisplayCircleObject | public GameObject focusDisplayCircleObject | |
focusDisplayObject | public GameObject focusDisplayObject | |
focusDisplayTransform | public RectTransform focusDisplayTransform | |
fontBody | public TMP_FontAsset fontBody | |
fontHeading | public TMP_FontAsset fontHeading | |
fontHeadingBold | public TMP_FontAsset fontHeadingBold | |
fontHeadingLight | public TMP_FontAsset fontHeadingLight | |
fxHighlightHide | public GameObject fxHighlightHide | |
fxHighlightShow | public GameObject fxHighlightShow | |
fxTick | public GameObject fxTick | |
isBackDisabled | `[NonSerialized] | |
| public bool isBackDisabled` | ||
onFocusedChanged | public Action<IGamepadFocusable, IGamepadFocusable> onFocusedChanged | |
tooltipBoxCanvasGroup | public CanvasGroup tooltipBoxCanvasGroup | |
tooltipBoxTransform | public RectTransform tooltipBoxTransform | |
tutHighlightBackdropBottom | public RectTransform tutHighlightBackdropBottom | |
tutHighlightBackdropLeft | public RectTransform tutHighlightBackdropLeft | |
tutHighlightBackdropRight | public RectTransform tutHighlightBackdropRight | |
tutHighlightBackdropTop | public RectTransform tutHighlightBackdropTop | |
tutHighlightBox | public RectTransform tutHighlightBox | |
tutHighlightObject | public GameObject tutHighlightObject | |
tutHighlightText | public TextMeshProUGUI tutHighlightText |
Properties
| Name | Declaration | Description |
|---|---|---|
focused | public IGamepadFocusable focused { get; } | |
isTooltipShown | public bool isTooltipShown { get; } | |
isTutorialHighlighting | public bool isTutorialHighlighting { get; } | |
lastFocusChangeUnscaledTime | public float lastFocusChangeUnscaledTime { get; } | |
tooltipScreenSpaceRect | public Rect tooltipScreenSpaceRect { get; } |
Methods
AddBackHandler(MonoBehaviour, int, Func<bool>)
Add handler for back buttons.Handler must return boolean value as indication of whether the back button event is consumed or not.Callback with highest priority will fire first when back button is pressed.If priority is the same, last added item will be fired first.If owner is destroyed, back handler will automatically be unregistered.
public BackHandler AddBackHandler(MonoBehaviour owner, int priority, Func<bool> callback)Parameters:
| Name | Type | Description |
|---|---|---|
owner | UnityEngine.MonoBehaviour | |
priority | int | |
callback | System.Func<TResult><bool> |
Returns: BackHandler
AddGamepadFocusable(IGamepadFocusable)
public void AddGamepadFocusable(IGamepadFocusable focusable)Parameters:
| Name | Type | Description |
|---|---|---|
focusable | IGamepadFocusable |
ClickHighlightForTutorial()
public void ClickHighlightForTutorial()EnforceFontFallbackOrder()
public void EnforceFontFallbackOrder()FrameUpdate()
public override void FrameUpdate()GetFocusedComponent<T>()
public T GetFocusedComponent<T>() where T : ComponentParameters:
| Name | Type | Description |
|---|---|---|
| `` | T |
Returns: T
GetIntersectingRects(List<Rect>, Vector2, Vector2, float, float)
public static List<GlobalUIManager.RectResult> GetIntersectingRects(List<Rect> rects, Vector2 origin, Vector2 direction, float angle, float radius)Parameters:
| Name | Type | Description |
|---|---|---|
rects | System.Collections.Generic.List<T><UnityEngine.Rect> | |
origin | UnityEngine.Vector2 | |
direction | UnityEngine.Vector2 | |
angle | float | |
radius | float |
Returns: System.Collections.Generic.List<T><GlobalUIManager.RectResult>
GoBack()
Handle go back event with registered handlers.
public void GoBack()HighlightForTutorial(TutorialHighlightSettings)
public IEnumerator HighlightForTutorial(TutorialHighlightSettings s)Parameters:
| Name | Type | Description |
|---|---|---|
s | TutorialHighlightSettings |
Returns: System.Collections.IEnumerator
IsUIElementClickable(RectTransform)
This checks for occlusions.
public bool IsUIElementClickable(RectTransform rectTransform)Parameters:
| Name | Type | Description |
|---|---|---|
rectTransform | UnityEngine.RectTransform |
Returns: bool
LogicUpdate(float)
public override void LogicUpdate(float dt)Parameters:
| Name | Type | Description |
|---|---|---|
dt | float |
MoveFocus(Vector3, float, float, float, Func<IGamepadFocusable, bool>, Func<IGamepadFocusable, float>)
public bool MoveFocus(Vector3 direction, float angleLimit, float normalizedPerpendicularDistLimit, float normalizedDistLimit, Func<IGamepadFocusable, bool> condition = null, Func<IGamepadFocusable, float> customScoreFunc = null)Parameters:
| Name | Type | Description |
|---|---|---|
direction | UnityEngine.Vector3 | |
angleLimit | float | |
normalizedPerpendicularDistLimit | float | |
normalizedDistLimit | float | |
condition | System.Func<T, TResult><IGamepadFocusable,bool> | |
customScoreFunc | System.Func<T, TResult><IGamepadFocusable,float> |
Returns: bool
MoveFocus(Vector3, Vector2, Vector2, Vector2, Func<IGamepadFocusable, bool>, Func<IGamepadFocusable, float>)
public bool MoveFocus(Vector3 direction, Vector2 angleLimit, Vector2 normalizedPerpendicularDistLimit, Vector2 normalizedDistLimit, Func<IGamepadFocusable, bool> condition = null, Func<IGamepadFocusable, float> customScoreFunc = null)Parameters:
| Name | Type | Description |
|---|---|---|
direction | UnityEngine.Vector3 | |
angleLimit | UnityEngine.Vector2 | |
normalizedPerpendicularDistLimit | UnityEngine.Vector2 | |
normalizedDistLimit | UnityEngine.Vector2 | |
condition | System.Func<T, TResult><IGamepadFocusable,bool> | |
customScoreFunc | System.Func<T, TResult><IGamepadFocusable,float> |
Returns: bool
MoveFocus(Vector3)
public bool MoveFocus(Vector3 direction)Parameters:
| Name | Type | Description |
|---|---|---|
direction | UnityEngine.Vector3 |
Returns: bool
PopulateCacheData(ref GetFocusTargetSettings, out Action)
Populate cache data for the given settings to make consecutive GetTarget calls faster.
public void PopulateCacheData(ref GetFocusTargetSettings settings, out Action handle)Parameters:
| Name | Type | Description |
|---|---|---|
settings | GetFocusTargetSettings | |
handle | System.Action |
RemoveBackHandler(BackHandler)
Remove the provided back handler if it exists in current handler list.If owner is destroyed, back handler will automatically be unregistered.
public void RemoveBackHandler(BackHandler handle)Parameters:
| Name | Type | Description |
|---|---|---|
handle | BackHandler |
RemoveGamepadFocusable(IGamepadFocusable)
public void RemoveGamepadFocusable(IGamepadFocusable focusable)Parameters:
| Name | Type | Description |
|---|---|---|
focusable | IGamepadFocusable |
SetFocus(IGamepadFocusable)
public void SetFocus(IGamepadFocusable focusable)Parameters:
| Name | Type | Description |
|---|---|---|
focusable | IGamepadFocusable |
SetFocusOnComponent(Component)
public void SetFocusOnComponent(Component focusable)Parameters:
| Name | Type | Description |
|---|---|---|
focusable | UnityEngine.Component |
SetFocusOnFirstFocusable(GameObject)
public void SetFocusOnFirstFocusable(GameObject parent)Parameters:
| Name | Type | Description |
|---|---|---|
parent | UnityEngine.GameObject |
ShowDevText(string, bool)
Show developer-only floating text in top-left corner of the screen for some time.This is not shown to non-developers.
public void ShowDevText(string rawText, bool log = true)Parameters:
| Name | Type | Description |
|---|---|---|
rawText | string | |
log | bool |
SimulateClickOnUIElement(Component)
public void SimulateClickOnUIElement(Component comp)Parameters:
| Name | Type | Description |
|---|---|---|
comp | UnityEngine.Component |
TryGetFocusTarget(GetFocusTargetSettings, out IGamepadFocusable)
public bool TryGetFocusTarget(GetFocusTargetSettings s, out IGamepadFocusable next)Parameters:
| Name | Type | Description |
|---|---|---|
s | GetFocusTargetSettings | |
next | IGamepadFocusable |
Returns: bool
TryGetFocusTargetGeneric(Vector3, Func<IGamepadFocusable, bool>, out IGamepadFocusable)
public bool TryGetFocusTargetGeneric(Vector3 direction, Func<IGamepadFocusable, bool> condition, out IGamepadFocusable next)Parameters:
| Name | Type | Description |
|---|---|---|
direction | UnityEngine.Vector3 | |
condition | System.Func<T, TResult><IGamepadFocusable,bool> | |
next | IGamepadFocusable |
Returns: bool
TryMoveFocusBack()
public bool TryMoveFocusBack()Returns: bool
UnhighlightForTutorial()
public void UnhighlightForTutorial()