From fe421e1b91bbb3f69e494ec58dd8092d61346f5e Mon Sep 17 00:00:00 2001 From: yyl <yyl> Date: 星期五, 05 九月 2025 15:25:31 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.1.20:10010/r/Project_SG_scripts --- Main/Component/UI/Core/ButtonEx.cs | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/Main/Component/UI/Core/ButtonEx.cs b/Main/Component/UI/Core/ButtonEx.cs index d70c07c..87d4365 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,19 @@ protected override void Awake() { base.Awake(); + originalScale = transform.localScale; + } + + public override void OnPointerDown(PointerEventData eventData) + { + 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