This commit is contained in:
yaoyanwei
2025-08-04 16:45:48 +08:00
parent 565aa16389
commit 2f2a601227
2296 changed files with 522745 additions and 93 deletions

View File

@@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace TcgEngine.UI
{
/// <summary>
/// Add to any UI element to make it resize on mobile (some buttons should be bigger on mobile)
/// </summary>
public class MobileResizeUI : MonoBehaviour
{
public Vector2 position_offset;
public float size = 1f;
void Start()
{
if (GameTool.IsMobile())
{
RectTransform rect = GetComponent<RectTransform>();
rect.anchoredPosition += position_offset;
transform.localScale = transform.localScale * size;
}
}
}
}