Class MaxWidthHeight
Helper class to constraint a RectTransfrom with a max size
Inheritance
System.Object
UnityEngine.Object
UnityEngine.Component
UnityEngine.Behaviour
UnityEngine.MonoBehaviour
UnityEngine.EventSystems.UIBehaviour
MaxWidthHeight
Namespace: BennyKok.RuntimeDebug.Components.UI
Assembly: com.bennykok.runtime-debug-action.dll
Syntax
[ExecuteAlways]
[RequireComponent(typeof(RectTransform))]
public class MaxWidthHeight : UIBehaviour, ILayoutSelfController, ILayoutController
Fields
MaximumPreferredSize
Declaration
[Tooltip("Maximum Preferred size when using Preferred Size")]
public Vector2 MaximumPreferredSize
Field Value
Type | Description |
---|---|
UnityEngine.Vector2 |
rectTransform
Declaration
public RectTransform rectTransform
Field Value
Type | Description |
---|---|
UnityEngine.RectTransform |
referenceRectTransfrom
Declaration
public RectTransform referenceRectTransfrom
Field Value
Type | Description |
---|---|
UnityEngine.RectTransform |
Methods
OnDisable()
Declaration
protected override void OnDisable()
Overrides
UnityEngine.EventSystems.UIBehaviour.OnDisable()
OnEnable()
Declaration
protected override void OnEnable()
Overrides
UnityEngine.EventSystems.UIBehaviour.OnEnable()
OnRectTransformDimensionsChange()
Declaration
protected override void OnRectTransformDimensionsChange()
Overrides
UnityEngine.EventSystems.UIBehaviour.OnRectTransformDimensionsChange()
SetDirty()
Declaration
protected void SetDirty()
SetLayoutHorizontal()
Calculate and apply the horizontal component of the size to the RectTransform
Declaration
public virtual void SetLayoutHorizontal()
SetLayoutVertical()
Calculate and apply the vertical component of the size to the RectTransform
Declaration
public virtual void SetLayoutVertical()
SetPreferredHeight(Single)
Declaration
public void SetPreferredHeight(float newHeight)
Parameters
Type | Name | Description |
---|---|---|
System.Single | newHeight |