29 lines
1.1 KiB
C#
29 lines
1.1 KiB
C#
using TMPro;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class SeccionItem : MonoBehaviour
|
|
{
|
|
public Button btn_JoinGame;
|
|
public Button btn_SelectGameRoom;
|
|
public TextMeshProUGUI txt_VenueInfo; // 场地信息:初级场/中级场/高级场
|
|
public TextMeshProUGUI txt_EntryCondition; // 入场条件文字
|
|
|
|
[Header("快速进入按钮按下缩放")]
|
|
public float pressScale = 0.95f; // 按下时卡片缩放比例
|
|
public float pressDuration = 0.1f; // 缩放动画时长
|
|
|
|
private void Awake()
|
|
{
|
|
if (btn_JoinGame == null) return;
|
|
|
|
// 「快速进入」按钮:按下缩小卡片,抬起还原
|
|
// 用只处理按下/抬起、不含拖动接口的 UIPressScale,避免抢走所在 ScrollRect 的滑动
|
|
var effect = btn_JoinGame.gameObject.GetComponent<UIPressScale>();
|
|
if (effect == null) effect = btn_JoinGame.gameObject.AddComponent<UIPressScale>();
|
|
effect.target = transform; // 缩放整个 SeccionItem 卡片
|
|
effect.pressScale = pressScale;
|
|
effect.duration = pressDuration;
|
|
}
|
|
}
|