UIView

class in Doozy.Engine.UI / Inherits from UIComponentBase

Description

The UIView is a core component in the DoozyUI system. It manages a container, that can contain any type of UI elements (buttons, toggles, images, texts...) and that can be animated in and out of view.
See Also: UIViewBehavior

Static Properties

  • public static string DefaultViewCategory – Default UIView view category name

  • public static string DefaultViewName – Default UIView view name

  • public static Action<UIView, UIViewBehaviorType> OnUIViewAction – Action invoked whenever a UIViewBehavior is triggered

  • public static readonly List VisibleViews – List of all the UIViews that are currently visible on screen

Properties

  • public Canvas Canvas – Reference to the Canvas component

  • public CanvasGroup CanvasGroup – Reference to the CanvasGroup component

  • public Vector3 CurrentStartPosition – Returns the current start position (anchoredPosition3D) by checking the UseCustomStartAnchoredPosition value.  Returns CustomStartAnchoredPosition, if UseCustomStartAnchoredPosition is TRUE. Returns StartPosition, if UseCustomStartAnchoredPosition is FALSE.

  • public GraphicRaycaster GraphicRaycaster – Reference to the GraphicRaycaster component

  • public float InverseVisibility – Returns the inverse of the current VisibilityProgress value (float between 1 and 0) (NotVisible – Visible)

  • public bool IsHidden – Returns TRUE if this UIView is NOT visible (is NOT in view)

  • public bool IsHiding – Returns TRUE if this UIView is playing the Hide Animation to get out of view

  • public bool IsShowing – Returns TRUE if this UIView is playing the Show Animation to become visible

  • public bool IsVisible – Returns TRUE if this UIView is visible (is in view)

  • public VisibilityState Visibility – The current visibility state of this UIView (Visible, NotVisible, Hiding or Showing)

  • public float VisibilityProgress – The visibility value of this UIView (float between 0 and 1) (NotVisible – Visible)

Public Variables

  • public bool AutoHideAfterShow – If TRUE, after this UIView gets shown, it will get automatically hidden after the AutoHideAfterShowDelay time interval has passed

  • public float AutoHideAfterShowDelay – If AutoHideAfterShow is TRUE, this is the time interval after which this UIView will get automatically hidden

  • public bool AutoSelectButtonAfterShow – If TRUE, after this UIView has been shown, the referenced SelectedButton GameObject will get automatically selected by EventSystem.current

  • public UIViewStartBehavior BehaviorAtStart – Determines the actions this UIView will automatically perform at Start (when it gets initialized)

  • public Vector3 CustomStartAnchoredPosition – A custom anchoredPosition3D that this UIView will have when it is shown. This is used to calculate the Show and Hide Move animations positions

  • public bool DeselectAnyButtonSelectedOnHide – If TRUE, when this UIView is hidden, any button that is selected (EventSystem.current) will get deselected

  • public bool DeselectAnyButtonSelectedOnShow – If TRUE, when this UIView is shown, any button that is selected (EventSystem.current) will get deselected

  • public bool DisableCanvasWhenHidden – If TRUE, when this UIView gets hidden, the Canvas component found on the same GameObject this UIView component is attached to, will be disabled

  • public bool DisableGameObjectWhenHidden – If TRUE, when this UIView gets hidden, the GameObject this UIView component is attached to, will be disabled

  • public bool DisableGraphicRaycasterWhenHidden – If TRUE, when this UIView gets hidden, the GraphicRaycaster component found on the same GameObject this UIView component is attached to, will be disabled

  • public UIViewBehavior HideBehavior – Behavior when this UIView gets hidden (goes off screen)

  • public Progressor HideProgressor – Reference to a Progressor that allows animating anything (texts, images, animations…) while hiding this view

  • public UIViewBehavior LoopBehavior – Loop animation started after this UIView gets shown and stopped before this UIView gets hidden

  • public ProgressEvent OnInverseVisibilityChanged – Callback executed when the view is animating (showing or hiding) and the progress has been updated. Passes the InverseVisibility (float between 1 – NotVisible and 0 – Visible). InverseVisibility = 1 – Visibility

  • public ProgressEvent OnVisibilityChanged – Callback executed when the view is animating (showing or hiding) and the progress has been updated. Passes the Visibility (float between 0 – NotVisible and 1 – Visible)

  • public GameObject SelectedButton – Reference to the GameObject that should be selected after this UIView has been shown. Works only if AutoSelectButtonAfterShow is TRUE

  • public UIViewBehavior ShowBehavior – Behavior when this UIView gets shown (becomes visible on screen)

  • public Progressor ShowProgressor – Reference to a Progressor that allows animating anything (texts, images, animations…) while showing this view

  • public TargetOrientation TargetOrientation – Determines on which orientation will this UIView be available for

  • public bool UpdateHideProgressorOnShow – Should the HideProgressor get updated when this UIView is showing?

  • public bool UpdateShowProgressorOnHide – Should the ShowProgressor get updated when this UIView is hiding?

  • public bool UseCustomStartAnchoredPosition – If TRUE, this UIView will ‘snap’ to the CustomStartAnchoredPosition in Awake (when the StartPosition is calculated)

  • public string ViewCategory – The category this UIView’s name belongs to

  • public string ViewName – The name of this UIView

Public Methods

  • public void CancelAutoHide() – Cancels an auto hide, if it was initiated

  • public void Hide(bool instantAction = false) – Hides this UIView

  • public void Hide(float delay) – Hides this UIView after the set delay

  • public void NotifySystemOfTriggeredBehavior(UIViewBehaviorType behaviorType) – Sends an UIViewMessage notifying the system that an UIViewBehavior has been triggered

  • public override void ResetAlpha() – Resets this UIView’s CanvasGroup.alpha to the StartAlpha value

  • public override void ResetPosition() – Resets this UIView’s RectTransform.anchoredPosition3D to the CurrentStartPosition value

  • public void Show(bool instantAction = false) – Shows this UIView

  • public void StartLoopAnimation() – Starts the loop animations set up on this UIView

  • public void StopLoopAnimation() – Stops any running loop animations on this UIView

  • public void Toggle(bool instantAction = false) – Toggles this UIView by showing it if it’s NOT visible or hiding it otherwise

Static Methods

  • public static List GetViews(string viewCategory, string viewName) – Returns a list of all the UIViews, registered in the UIView.Database, with the given view category and view name. If not UIView is found, it will return an empty list.

  • public static void HideView(string viewName, bool instantAction = false) – Hides all the UIViews with the passed view name and the default view category name ‘General’. Note that if an UIView view category and view name are set to the default values, the HIDE animation will NOT play.

  • public static void HideView(string viewCategory, string viewName, bool instantAction = false) – Hides all the UIViews with the passed view category and view name. Note that if an UIView view category and view name are set to the default values, the HIDE animation will NOT play.

  • public static void HideViewCategory(string viewCategory, bool instantAction = false) – Hide all the UIViews with the passed view category

  • public static bool IsViewVisible(string viewCategory, string viewName) – Returns TRUE if at least one UIView, with the passed view category and view name, is visible. An UIView is considered visible if its IsVisible value is true and if it has been added to the VisibleViews list.

  • public static void ShowView(string viewName, bool instantAction = false) – Shows all the UIViews with the passed view name and the default view category name ‘General’. Note that if an UIView view category and view name are set to the default values, the SHOW animation will NOT play.

  • public static void ShowView(string viewCategory, string viewName, bool instantAction = false) – Shows all the UIViews with the passed view category and view name. Note that if an UIView view category and view name are set to the default values, the SHOW animation will NOT play.

  • public static void ShowViewCategory(string viewCategory, bool instantAction = false) – Show all the UIViews with the passed view category