mirror of
https://github.com/peng-zhihui/ElectronBot.git
synced 2026-10-23 15:58:35 +08:00
29 lines
652 B
C#
29 lines
652 B
C#
namespace UIWidgets.Examples
|
|
{
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// Test DoubleCarousel resize.
|
|
/// </summary>
|
|
public class TestDoubleCarousel : MonoBehaviour
|
|
{
|
|
/// <summary>
|
|
/// DoubleCarousel.
|
|
/// </summary>
|
|
[SerializeField]
|
|
protected RectTransform DoubleCarousel;
|
|
|
|
/// <summary>
|
|
/// Test resize.
|
|
/// </summary>
|
|
public void TestResize()
|
|
{
|
|
var size = (DoubleCarousel.rect.width == 512)
|
|
? new Vector2(300, 300)
|
|
: new Vector2(512, 512);
|
|
|
|
DoubleCarousel.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, size.x);
|
|
DoubleCarousel.SetSizeWithCurrentAnchors(RectTransform.Axis.Vertical, size.y);
|
|
}
|
|
}
|
|
} |