Dynamic Header Scripting Dark Center Band Scripting


class in Doozy.Engine.UI.Base


The UIContainer is a base class for any UI component that has a RectTransform and also needs to have the Canvas, GraphicRaycaster and CanvasGroup components attached

Public Variables

  • public Canvas Canvas – Reference to the Canvas component

  • public CanvasGroup CanvasGroup – Reference to the CanvasGroup component

  • public bool DisableCanvas – If TRUE, the Canvas component can be automatically disabled when not in view

  • public bool DisableGameObject – If TRUE, the container’s GameObject can be automatically disabled when not in view

  • public bool DisableGraphicRaycaster – If TRUE, the GraphicRaycaster component can be automatically disabled when not in view

  • public bool Enabled – Deactivates the usage this UIContainer by other components

  • public GraphicRaycaster GraphicRaycaster – Reference to the GraphicRaycaster component

  • public RectTransform RectTransform – Reference to the RectTransform component

  • public float StartAlpha – Holds the start alpha. It does that by checking if a CanvasGroup component is attached (holding the alpha value) or it just remembers 1 (as in 100% visibility)

  • public Vector3 StartPosition – Holds the start RectTransform.anchoredPosition3D

  • public Vector3 StartRotation – Holds the start RectTransform.localEulerAngles

  • public Vector3 StartScale – Holds the start RectTransform.localScale


  • public UIContainer() – Initializes a new instance of the class

Public Methods

  • public virtual void Disable() – If RectTransform != null, disables the RectTransform.gameObject (if DisableGameObject is TRUE), disables the Canvas component (if DisableCanvas is TRUE) and disables the GraphicRaycaster component (if DisableGraphicRaycaster is TRUE)

  • public virtual void Enable() – If Enabled is TRUE and RectTransform != null, it enables the GameObject, the Canvas and the GraphicRaycaster components

  • public void FullScreen(bool resetScaleToOne) – Makes the RectTransform match its parent size

  • public virtual void Init() – Initializes this instance by checking for a RectTransform and then getting the references for the Canvas, GraphicRaycaster and CanvasGroup components

  • public virtual void Reset() – Resets this instance to the default values

  • public virtual void ResetAlpha() – Resets the CanvasGroup.alpha to the StartAlpha value (if a CanvasGroup is attached)

  • public virtual void ResetPosition() – Resets the RectTransform.anchoredPosition3D to the StartPosition value

  • public virtual void ResetRotation() – Resets the RectTransform.localEulerAngles to the StartRotation value

  • public virtual void ResetScale() – Resets the RectTransform.localScale to the StartScale value

  • public virtual void ResetToStartValues() – Resets this RectTransform’s value to the Start values (StartPosition, StartRotation, StartScale and StartAlpha)

  • public virtual void UpdateStartAlpha() – Updates the StartAlpha to the CanvasGroup.alpha value (if a CanvasGroup is attached)

  • public virtual void UpdateStartPosition() – Updates the StartPosition to the RectTransform.anchoredPosition3D value

  • public virtual void UpdateStartRotation() – Updates the StartRotation to the RectTransform.localEulerAngles value

  • public virtual void UpdateStartScale() – Updates the StartScale to the RectTransform.localScale value

  • public virtual void UpdateStartValues() – Updates the StartPosition, StartRotation, StartScale and StartAlpha for this RectTransform to the current values