Class UIContainer
Basic container with show and hide capabilities. All other containers use this as their base.
Implements
Namespace: Doozy.Runtime.UIManager.Containers
Assembly: cs.temp.dll.dll
Syntax
public class UIContainer : MonoBehaviour
Constructors
UIContainer()
Declaration
public UIContainer()
Fields
AutoHideAfterShow
If TRUE, after this container gets shown, it will get automatically hidden after the AutoHideAfterShowDelay time interval has passed
Declaration
public bool AutoHideAfterShow
Field Value
Type | Description |
---|---|
Boolean |
AutoHideAfterShowDelay
If AutoHideAfterShow is TRUE, this is the time interval after which this container will get automatically hidden
Declaration
public float AutoHideAfterShowDelay
Field Value
Type | Description |
---|---|
Single |
AutoSelectAfterShow
If TRUE, after this container has been shown, the referenced selectable GameObject will get automatically selected by EventSystem.current
Declaration
public bool AutoSelectAfterShow
Field Value
Type | Description |
---|---|
Boolean |
AutoSelectTarget
Reference to the GameObject that should be selected after this container has been shown. Works only if AutoSelectAfterShow is TRUE
Declaration
public GameObject AutoSelectTarget
Field Value
Type | Description |
---|---|
GameObject |
ClearSelectedOnHide
If TRUE, when this container is hidden, any GameObject that is selected by the EventSystem.current will get deselected
Declaration
public bool ClearSelectedOnHide
Field Value
Type | Description |
---|---|
Boolean |
ClearSelectedOnShow
If TRUE, when this container is shown, any GameObject that is selected by the EventSystem.current will get deselected
Declaration
public bool ClearSelectedOnShow
Field Value
Type | Description |
---|---|
Boolean |
CustomStartPosition
AnchoredPosition3D to snap to on Awake
Declaration
public Vector3 CustomStartPosition
Field Value
Type | Description |
---|---|
Vector3 |
DisableCanvasWhenHidden
If TRUE, when this container gets hidden, the Canvas component found on the same GameObject this container component is attached to, will be disabled
Declaration
public bool DisableCanvasWhenHidden
Field Value
Type | Description |
---|---|
Boolean |
DisableGameObjectWhenHidden
If TRUE, when this container gets hidden, the GameObject this container component is attached to, will be disabled
Declaration
public bool DisableGameObjectWhenHidden
Field Value
Type | Description |
---|---|
Boolean |
DisableGraphicRaycasterWhenHidden
If TRUE, when this container gets hidden, the GraphicRaycaster component found on the same GameObject this container component is attached to, will be disabled
Declaration
public bool DisableGraphicRaycasterWhenHidden
Field Value
Type | Description |
---|---|
Boolean |
HandleCanvasGroupBlockRaycasts
Controls the Block Raycasts property of the target CanvasGroup component
Declaration
public bool HandleCanvasGroupBlockRaycasts
Field Value
Type | Description |
---|---|
Boolean |
k_DefaultAnimationDuration
Default animation duration
Declaration
public const float k_DefaultAnimationDuration = 0.3F
Field Value
Type | Description |
---|---|
Single |
k_StreamCategory
Stream category name
Declaration
public const string k_StreamCategory = "UIContainer"
Field Value
Type | Description |
---|---|
String |
OnHiddenCallback
Hidden - Hide animation finished - callback invoked when visibility state changed to Hidden
Declaration
public ModyEvent OnHiddenCallback
Field Value
Type | Description |
---|---|
ModyEvent |
OnHideCallback
Hide animation started - executed when visibility state changed to IsHiding
Declaration
public ModyEvent OnHideCallback
Field Value
Type | Description |
---|---|
ModyEvent |
OnShowCallback
Show animation started - executed when visibility state changed to IsShowing
Declaration
public ModyEvent OnShowCallback
Field Value
Type | Description |
---|---|
ModyEvent |
OnStartBehaviour
Behaviour on Start
Declaration
public ContainerBehaviour OnStartBehaviour
Field Value
Type | Description |
---|---|
ContainerBehaviour |
OnVisibilityChangedCallback
Visibility changed - callback invoked when visibility state changed
Declaration
public VisibilityStateEvent OnVisibilityChangedCallback
Field Value
Type | Description |
---|---|
VisibilityStateEvent |
OnVisibleCallback
Visible - Show animation finished - executed when visibility state changed to Visible
Declaration
public ModyEvent OnVisibleCallback
Field Value
Type | Description |
---|---|
ModyEvent |
UseCustomStartPosition
If TRUE, the rectTransform.anchoredPosition3D will 'snap' to the CustomStartPosition on Awake
Declaration
public bool UseCustomStartPosition
Field Value
Type | Description |
---|---|
Boolean |
VisibilityState
Current visibility state
Declaration
protected VisibilityState VisibilityState
Field Value
Type | Description |
---|---|
VisibilityState |
Properties
anyAnimationIsActive
Check if any Show or Hide animation is active (running)
Declaration
public bool anyAnimationIsActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
anyHideAnimationIsActive
Check if any Hide animation is active (running)
Declaration
public bool anyHideAnimationIsActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
anyHideProgressorIsActive
Check if any referenced Hide progressor is active (running)
Declaration
public bool anyHideProgressorIsActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
anyProgressorIsActive
Check if any referenced progressor is active (running)
Declaration
public bool anyProgressorIsActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
anyShowAnimationIsActive
Check if any Show animation is active (running)
Declaration
public bool anyShowAnimationIsActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
anyShowHideProgressorIsActive
Check if any referenced ShowHide progressor is active (running)
Declaration
public bool anyShowHideProgressorIsActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
anyShowProgressorIsActive
Check if any referenced Show progressor is active (running)
Declaration
public bool anyShowProgressorIsActive { get; }
Property Value
Type | Description |
---|---|
Boolean |
canvas
Reference to the Canvas component attached to this GameObject
Declaration
public Canvas canvas { get; }
Property Value
Type | Description |
---|---|
Canvas |
canvasGroup
Reference to the CanvasGroup component attached to this GameObject
Declaration
public CanvasGroup canvasGroup { get; }
Property Value
Type | Description |
---|---|
CanvasGroup |
executedFirstCommand
Flag to keep track if the first show/hide command has been issued
Declaration
public bool executedFirstCommand { get; protected set; }
Property Value
Type | Description |
---|---|
Boolean |
graphicRaycaster
Reference to the GraphicRaycaster component attached to this GameObject
Declaration
public GraphicRaycaster graphicRaycaster { get; }
Property Value
Type | Description |
---|---|
GraphicRaycaster |
hasCallbacks
Returns TRUE if any of the available callbacks has at least one listener
Declaration
public bool hasCallbacks { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasCanvas
Flag used to determine if a Canvas component is attached to this GameObject
Declaration
public bool hasCanvas { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasCanvasGroup
Flag used to determine if a CanvasGroup component is attached to this GameObject
Declaration
public bool hasCanvasGroup { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasGraphicRaycaster
Flag used to determine if a CanvasGroup component is attached to this GameObject
Declaration
public bool hasGraphicRaycaster { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasHideProgressors
Check if there are any referenced Hide progressors
Declaration
public bool hasHideProgressors { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasHideReactions
Check if there are any referenced Hide reactions
Declaration
public bool hasHideReactions { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasMultiplayerInfo
Check if a MultiplayerInfo has been referenced
Declaration
public bool hasMultiplayerInfo { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasOnHiddenCallbacks
Returns TRUE if the OnHiddenCallback event is not null and has at least one listener
Declaration
public bool hasOnHiddenCallbacks { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasOnHideCallbacks
Returns TRUE if the OnHideCallback event is not null and has at least one listener
Declaration
public bool hasOnHideCallbacks { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasOnShowCallbacks
Returns TRUE if the OnShowCallback event is not null and has at least one listener
Declaration
public bool hasOnShowCallbacks { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasOnVisibilityChangedCallbacks
Returns TRUE if the OnVisibilityChangedCallback event is not null and has at least one listener
Declaration
public bool hasOnVisibilityChangedCallbacks { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasOnVisibleCallbacks
Returns TRUE if the OnVisibleCallback event is not null and has at least one listener
Declaration
public bool hasOnVisibleCallbacks { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasProgressors
Check if there are any referenced progressors
Declaration
public bool hasProgressors { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasShowHideProgressors
Check if there are any referenced ShowHide progressors
Declaration
public bool hasShowHideProgressors { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasShowProgressors
Check if there are any referenced Show progressors
Declaration
public bool hasShowProgressors { get; }
Property Value
Type | Description |
---|---|
Boolean |
hasShowReactions
Check if there are any referenced Show reactions
Declaration
public bool hasShowReactions { get; }
Property Value
Type | Description |
---|---|
Boolean |
hideProgressors
Progressors triggered on Hide. Plays forward.
Declaration
public List<Progressor> hideProgressors { get; }
Property Value
Type | Description |
---|---|
List<Progressor> |
inputSettings
Reference to the UIManager Input Settings
Declaration
public static UIManagerInputSettings inputSettings { get; }
Property Value
Type | Description |
---|---|
UIManagerInputSettings |
inTransition
Visibility state is either IsShowing or IsHiding - either Show or Hide animation is running
Declaration
public bool inTransition { get; }
Property Value
Type | Description |
---|---|
Boolean |
isHidden
Visibility state is Hidden
Declaration
public bool isHidden { get; }
Property Value
Type | Description |
---|---|
Boolean |
isHiding
Visibility state is IsHiding - Hide animation is running
Declaration
public bool isHiding { get; }
Property Value
Type | Description |
---|---|
Boolean |
isShowing
Visibility state is IsShowing - Show animation is running
Declaration
public bool isShowing { get; }
Property Value
Type | Description |
---|---|
Boolean |
isVisible
Visibility state is Visible
Declaration
public bool isVisible { get; }
Property Value
Type | Description |
---|---|
Boolean |
multiplayerInfo
Reference to the MultiPlayerInfo component
Declaration
public MultiplayerInfo multiplayerInfo { get; }
Property Value
Type | Description |
---|---|
MultiplayerInfo |
multiplayerMode
Check if Multiplayer Mode is enabled
Declaration
public static bool multiplayerMode { get; }
Property Value
Type | Description |
---|---|
Boolean |
playerIndex
Player index for this component
Declaration
public int playerIndex { get; }
Property Value
Type | Description |
---|---|
Int32 |
previouslyExecutedCommand
Keeps track of the previously executed show/hide command
Declaration
public ShowHideExecute previouslyExecutedCommand { get; protected set; }
Property Value
Type | Description |
---|---|
ShowHideExecute |
rectTransform
Reference to the RectTransform component attached to this GameObject
Declaration
public RectTransform rectTransform { get; }
Property Value
Type | Description |
---|---|
RectTransform |
showHideExecute
Action invoked every time before the container needs to change its state
Declaration
public UnityAction<ShowHideExecute> showHideExecute { get; set; }
Property Value
Type | Description |
---|---|
UnityAction<ShowHideExecute> |
showHideProgressors
Progressors triggered on both Show and Hide. Plays forward on Show and in reverse on Hide.
Declaration
public List<Progressor> showHideProgressors { get; }
Property Value
Type | Description |
---|---|
List<Progressor> |
showProgressors
Progressors triggered on Show. Plays forward.
Declaration
public List<Progressor> showProgressors { get; }
Property Value
Type | Description |
---|---|
List<Progressor> |
totalDurationForHide
Get the maximum duration for the Hide animations Max(startDelay) + Max(duration).
At start this value can be calculated only after 2 frames have passed (the time it takes for the reactions to register)
For reactions that use random intervals for startDelay and/or duration, the maximum interval values are taken into account
Declaration
public float totalDurationForHide { get; }
Property Value
Type | Description |
---|---|
Single |
totalDurationForShow
Get the maximum duration for the Show animations Max(startDelay) + Max(duration).
At start this value can be calculated only after 2 frames have passed (the time it takes for the reactions to register)
For reactions that use random intervals for startDelay and/or duration, the maximum interval values are taken into account
Declaration
public float totalDurationForShow { get; }
Property Value
Type | Description |
---|---|
Single |
visibilityState
Current visibility state
Declaration
public VisibilityState visibilityState { get; }
Property Value
Type | Description |
---|---|
VisibilityState |
Methods
Awake()
Declaration
protected virtual void Awake()
GraphicUpdateComplete()
Declaration
public virtual void GraphicUpdateComplete()
Hide()
Hide with animations.
Triggers visibility states IsHiding when Hide starts and then Hidden when Hide finished.
Declaration
public virtual void Hide()
Hide(Boolean)
Hide with animations.
Triggers visibility states IsHiding when Hide starts and then Hidden when Hide finished.
Declaration
public virtual void Hide(bool triggerCallbacks)
Parameters
Type | Name | Description |
---|---|---|
Boolean | triggerCallbacks | Should callbacks be triggered or not |
InstantHide()
Hide in the current frame without animations.
Triggers visibility states IsHiding and then Hidden.
Declaration
public virtual void InstantHide()
InstantHide(Boolean)
Hide in the current frame without animations.
Triggers visibility states IsHiding and then Hidden.
Declaration
public virtual void InstantHide(bool triggerCallbacks)
Parameters
Type | Name | Description |
---|---|---|
Boolean | triggerCallbacks | Should callbacks be triggered or not |
InstantShow()
Show in the current frame without animations.
Triggers visibility states IsShowing and then Visible.
Declaration
public virtual void InstantShow()
InstantShow(Boolean)
Show in the current frame without animations.
Triggers visibility states IsShowing and then Visible.
Declaration
public virtual void InstantShow(bool triggerCallbacks)
Parameters
Type | Name | Description |
---|---|---|
Boolean | triggerCallbacks | Should callbacks be triggered or not |
InstantShowHide(Boolean)
Show or hide in the current frame without animations.
Declaration
public virtual void InstantShowHide(bool show)
Parameters
Type | Name | Description |
---|---|---|
Boolean | show | Should trigger show or hide |
InstantShowHide(Boolean, Boolean)
Show or hide in the current frame without animations.
Declaration
public virtual void InstantShowHide(bool show, bool triggerCallbacks)
Parameters
Type | Name | Description |
---|---|---|
Boolean | show | Should trigger show or hide |
Boolean | triggerCallbacks | Should callbacks be triggered or not |
InstantToggle()
Toggles the visibility state. If Visible or IsShowing calls InstantHide. If Hidden or IsHiding calls InstantShow.
Declaration
public virtual void InstantToggle()
InstantToggle(Boolean)
Toggles the visibility state. If Visible or IsShowing calls InstantHide. If Hidden or IsHiding calls InstantShow.
Declaration
public virtual void InstantToggle(bool triggerCallbacks)
Parameters
Type | Name | Description |
---|---|---|
Boolean | triggerCallbacks | Should callbacks be triggered or not |
IsDestroyed()
Declaration
public bool IsDestroyed()
Returns
Type | Description |
---|---|
Boolean |
LayoutComplete()
Declaration
public virtual void LayoutComplete()
OnDestroy()
Declaration
protected virtual void OnDestroy()
OnDisable()
Declaration
protected virtual void OnDisable()
OnEnable()
Declaration
protected virtual void OnEnable()
Rebuild(CanvasUpdate)
Declaration
public virtual void Rebuild(CanvasUpdate executing)
Parameters
Type | Name | Description |
---|---|---|
CanvasUpdate | executing |
RunBehaviour(ContainerBehaviour)
Declaration
protected virtual void RunBehaviour(ContainerBehaviour behaviour)
Parameters
Type | Name | Description |
---|---|---|
ContainerBehaviour | behaviour |
SetCustomStartPosition(Vector3, Boolean)
Set the custom start position for the UIContainer.
Declaration
public virtual void SetCustomStartPosition(Vector3 startPosition, bool jumpToPosition = true)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | startPosition | The new start position |
Boolean | jumpToPosition | If true, the UIContainer will be immediately moved to the new position |
SetMultiplayerInfo(MultiplayerInfo)
Set the a reference to a MultiplayerInfo
Declaration
public void SetMultiplayerInfo(MultiplayerInfo reference)
Parameters
Type | Name | Description |
---|---|---|
MultiplayerInfo | reference | MultiplayerInfo reference |
SetSelected(GameObject)
Set the given GameObject as the selected object in the EventSystem or MultiplayerEventSystem, depending on the current input system and if multiplayer mode is enabled.
Declaration
protected virtual void SetSelected(GameObject selectable)
Parameters
Type | Name | Description |
---|---|---|
GameObject | selectable | The GameObject to select |
Show()
Show with animations.
Triggers visibility states IsShowing when Show starts and then Visible when Show finished.
Declaration
public virtual void Show()
Show(Boolean)
Show with animations.
Triggers visibility states IsShowing when Show starts and then Visible when Show finished.
Declaration
public virtual void Show(bool triggerCallbacks)
Parameters
Type | Name | Description |
---|---|---|
Boolean | triggerCallbacks | Should callbacks be triggered or not |
ShowHide(Boolean)
Show or Hide with animations.
Declaration
public virtual void ShowHide(bool show)
Parameters
Type | Name | Description |
---|---|---|
Boolean | show | Show or Hide |
ShowHide(Boolean, Boolean)
Show or Hide with animations.
Declaration
public virtual void ShowHide(bool show, bool triggerCallbacks)
Parameters
Type | Name | Description |
---|---|---|
Boolean | show | Show or Hide |
Boolean | triggerCallbacks | Should callbacks be triggered or not |
Start()
Declaration
protected virtual void Start()
Toggle()
Toggle the visibility state. If Visible or IsShowing calls Hide. If Hidden or IsHiding calls Show.
Declaration
public virtual void Toggle()
Toggle(Boolean)
Toggle the visibility state. If Visible or IsShowing calls Hide. If Hidden or IsHiding calls Show.
Declaration
public virtual void Toggle(bool triggerCallbacks)
Parameters
Type | Name | Description |
---|---|---|
Boolean | triggerCallbacks | Should callbacks be triggered or not |