Layout Switcher

Allows creating different layouts with the same GameObjects for different screen sizes and aspect ratios. Used when anchors, pivots and layout groups not enough to create a layout with different aspect ratios support.

Saves the values of the position, size, anchors, pivot, rotation, scale, active/disable state for each layout.

Options

  • Objects List<RectTransform>

    List of the controlled objects.

  • Default Display Size (inches) float

    Display size to use when actual display size cannot be detected.

  • Layouts List<UILayout>

    List of the layouts.

    • Name string

      Layout name.

    • Aspect Ratio Vector2

      Aspect ratio for this layout.

    • Max Display Size (inches) float

      Maximum size of the display for this layout (layout will not be used if display size more than the specified one).

Events

  • LayoutChanged UnityEvent<UILayout>