From 09bc892c7283df8757a07b646d5af21ddaa263d1 Mon Sep 17 00:00:00 2001
From: lcy <1459594991@qq.com>
Date: 星期四, 06 十一月 2025 18:22:34 +0800
Subject: [PATCH] 164 天子的考验-客户端
---
Main/Component/UI/Core/ButtonEx.cs | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
diff --git a/Main/Component/UI/Core/ButtonEx.cs b/Main/Component/UI/Core/ButtonEx.cs
index d70c07c..7342ebf 100644
--- a/Main/Component/UI/Core/ButtonEx.cs
+++ b/Main/Component/UI/Core/ButtonEx.cs
@@ -14,8 +14,11 @@
public bool customNegativeSound = false;
public int positiveSound = 0;
public int negativeSound = 0;
+ public float pressedScale = 1.1f;
float m_AbleTime = 0f;
+ private Vector3 originalScale;
+
public float ableTime {
get { return m_AbleTime; }
private set {
@@ -44,6 +47,23 @@
protected override void Awake()
{
base.Awake();
+ originalScale = transform.localScale;
+ }
+
+ public override void OnPointerDown(PointerEventData eventData)
+ {
+ if (this.interactable == false)
+ {
+ return;
+ }
+ base.OnPointerDown(eventData);
+ transform.localScale = originalScale * pressedScale;
+ }
+
+ public override void OnPointerUp(PointerEventData eventData)
+ {
+ base.OnPointerUp(eventData);
+ transform.localScale = originalScale;
}
private void PlayPositiveSound()
--
Gitblit v1.8.0