Skip to content

Class: GlobalUIManager ​

csharp
public class GlobalUIManager : ManagerBase<GlobalUIManager>, ILogicUpdate

Fields ​

NameDeclarationDescription
currentMenuView`[NonSerialized]
public IMenuView currentMenuView`
devFloatingTextParentpublic RectTransform devFloatingTextParent
devFloatingTextPrefabpublic TextMeshProUGUI devFloatingTextPrefab
focusDisplayAnimationTargetpublic Transform focusDisplayAnimationTarget
focusDisplayBoxObjectpublic GameObject focusDisplayBoxObject
focusDisplayCircleObjectpublic GameObject focusDisplayCircleObject
focusDisplayObjectpublic GameObject focusDisplayObject
focusDisplayTransformpublic RectTransform focusDisplayTransform
fontBodypublic TMP_FontAsset fontBody
fontHeadingpublic TMP_FontAsset fontHeading
fontHeadingBoldpublic TMP_FontAsset fontHeadingBold
fontHeadingLightpublic TMP_FontAsset fontHeadingLight
fxHighlightHidepublic GameObject fxHighlightHide
fxHighlightShowpublic GameObject fxHighlightShow
fxTickpublic GameObject fxTick
isBackDisabled`[NonSerialized]
public bool isBackDisabled`
onFocusedChangedpublic Action&lt;IGamepadFocusable, IGamepadFocusable&gt; onFocusedChanged
tooltipBoxCanvasGrouppublic CanvasGroup tooltipBoxCanvasGroup
tooltipBoxTransformpublic RectTransform tooltipBoxTransform
tutHighlightBackdropBottompublic RectTransform tutHighlightBackdropBottom
tutHighlightBackdropLeftpublic RectTransform tutHighlightBackdropLeft
tutHighlightBackdropRightpublic RectTransform tutHighlightBackdropRight
tutHighlightBackdropToppublic RectTransform tutHighlightBackdropTop
tutHighlightBoxpublic RectTransform tutHighlightBox
tutHighlightObjectpublic GameObject tutHighlightObject
tutHighlightTextpublic TextMeshProUGUI tutHighlightText

Properties ​

NameDeclarationDescription
focusedpublic IGamepadFocusable focused { get; }
isTooltipShownpublic bool isTooltipShown { get; }
isTutorialHighlightingpublic bool isTutorialHighlighting { get; }
lastFocusChangeUnscaledTimepublic float lastFocusChangeUnscaledTime { get; }
tooltipScreenSpaceRectpublic Rect tooltipScreenSpaceRect { get; }

Methods ​

AddBackHandler(MonoBehaviour, int, Func&lt;bool&gt;) ​

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.

csharp
public BackHandler AddBackHandler(MonoBehaviour owner, int priority, Func<bool> callback)

Parameters:

NameTypeDescription
ownerUnityEngine.MonoBehaviour
priorityint
callbackSystem.Func&lt;TResult&gt;&lt;bool&gt;

Returns: BackHandler

AddGamepadFocusable(IGamepadFocusable) ​

csharp
public void AddGamepadFocusable(IGamepadFocusable focusable)

Parameters:

NameTypeDescription
focusableIGamepadFocusable

ClickHighlightForTutorial() ​

csharp
public void ClickHighlightForTutorial()

EnforceFontFallbackOrder() ​

csharp
public void EnforceFontFallbackOrder()

FrameUpdate() ​

csharp
public override void FrameUpdate()

GetFocusedComponent&lt;T&gt;() ​

csharp
public T GetFocusedComponent<T>() where T : Component

Parameters:

NameTypeDescription
``T

Returns: T

GetIntersectingRects(List&lt;Rect&gt;, Vector2, Vector2, float, float) ​

csharp
public static List<GlobalUIManager.RectResult> GetIntersectingRects(List<Rect> rects, Vector2 origin, Vector2 direction, float angle, float radius)

Parameters:

NameTypeDescription
rectsSystem.Collections.Generic.List&lt;T&gt;&lt;UnityEngine.Rect&gt;
originUnityEngine.Vector2
directionUnityEngine.Vector2
anglefloat
radiusfloat

Returns: System.Collections.Generic.List&lt;T&gt;&lt;GlobalUIManager.RectResult&gt;

GoBack() ​

Handle go back event with registered handlers.

csharp
public void GoBack()

HighlightForTutorial(TutorialHighlightSettings) ​

csharp
public IEnumerator HighlightForTutorial(TutorialHighlightSettings s)

Parameters:

NameTypeDescription
sTutorialHighlightSettings

Returns: System.Collections.IEnumerator

IsUIElementClickable(RectTransform) ​

This checks for occlusions.

csharp
public bool IsUIElementClickable(RectTransform rectTransform)

Parameters:

NameTypeDescription
rectTransformUnityEngine.RectTransform

Returns: bool

LogicUpdate(float) ​

csharp
public override void LogicUpdate(float dt)

Parameters:

NameTypeDescription
dtfloat

MoveFocus(Vector3, float, float, float, Func&lt;IGamepadFocusable, bool&gt;, Func&lt;IGamepadFocusable, float&gt;) ​

csharp
public bool MoveFocus(Vector3 direction, float angleLimit, float normalizedPerpendicularDistLimit, float normalizedDistLimit, Func<IGamepadFocusable, bool> condition = null, Func<IGamepadFocusable, float> customScoreFunc = null)

Parameters:

NameTypeDescription
directionUnityEngine.Vector3
angleLimitfloat
normalizedPerpendicularDistLimitfloat
normalizedDistLimitfloat
conditionSystem.Func<T, TResult><IGamepadFocusable,bool>
customScoreFuncSystem.Func<T, TResult><IGamepadFocusable,float>

Returns: bool

MoveFocus(Vector3, Vector2, Vector2, Vector2, Func&lt;IGamepadFocusable, bool&gt;, Func&lt;IGamepadFocusable, float&gt;) ​

csharp
public bool MoveFocus(Vector3 direction, Vector2 angleLimit, Vector2 normalizedPerpendicularDistLimit, Vector2 normalizedDistLimit, Func<IGamepadFocusable, bool> condition = null, Func<IGamepadFocusable, float> customScoreFunc = null)

Parameters:

NameTypeDescription
directionUnityEngine.Vector3
angleLimitUnityEngine.Vector2
normalizedPerpendicularDistLimitUnityEngine.Vector2
normalizedDistLimitUnityEngine.Vector2
conditionSystem.Func<T, TResult><IGamepadFocusable,bool>
customScoreFuncSystem.Func<T, TResult><IGamepadFocusable,float>

Returns: bool

MoveFocus(Vector3) ​

csharp
public bool MoveFocus(Vector3 direction)

Parameters:

NameTypeDescription
directionUnityEngine.Vector3

Returns: bool

PopulateCacheData(ref GetFocusTargetSettings, out Action) ​

Populate cache data for the given settings to make consecutive GetTarget calls faster.

csharp
public void PopulateCacheData(ref GetFocusTargetSettings settings, out Action handle)

Parameters:

NameTypeDescription
settingsGetFocusTargetSettings
handleSystem.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.

csharp
public void RemoveBackHandler(BackHandler handle)

Parameters:

NameTypeDescription
handleBackHandler

RemoveGamepadFocusable(IGamepadFocusable) ​

csharp
public void RemoveGamepadFocusable(IGamepadFocusable focusable)

Parameters:

NameTypeDescription
focusableIGamepadFocusable

SetFocus(IGamepadFocusable) ​

csharp
public void SetFocus(IGamepadFocusable focusable)

Parameters:

NameTypeDescription
focusableIGamepadFocusable

SetFocusOnComponent(Component) ​

csharp
public void SetFocusOnComponent(Component focusable)

Parameters:

NameTypeDescription
focusableUnityEngine.Component

SetFocusOnFirstFocusable(GameObject) ​

csharp
public void SetFocusOnFirstFocusable(GameObject parent)

Parameters:

NameTypeDescription
parentUnityEngine.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.

csharp
public void ShowDevText(string rawText, bool log = true)

Parameters:

NameTypeDescription
rawTextstring
logbool

SimulateClickOnUIElement(Component) ​

csharp
public void SimulateClickOnUIElement(Component comp)

Parameters:

NameTypeDescription
compUnityEngine.Component

TryGetFocusTarget(GetFocusTargetSettings, out IGamepadFocusable) ​

csharp
public bool TryGetFocusTarget(GetFocusTargetSettings s, out IGamepadFocusable next)

Parameters:

NameTypeDescription
sGetFocusTargetSettings
nextIGamepadFocusable

Returns: bool

TryGetFocusTargetGeneric(Vector3, Func&lt;IGamepadFocusable, bool&gt;, out IGamepadFocusable) ​

csharp
public bool TryGetFocusTargetGeneric(Vector3 direction, Func<IGamepadFocusable, bool> condition, out IGamepadFocusable next)

Parameters:

NameTypeDescription
directionUnityEngine.Vector3
conditionSystem.Func<T, TResult><IGamepadFocusable,bool>
nextIGamepadFocusable

Returns: bool

TryMoveFocusBack() ​

csharp
public bool TryMoveFocusBack()

Returns: bool

UnhighlightForTutorial() ​

csharp
public void UnhighlightForTutorial()

Maintained by the Shape of Dreams Modding Community