Fix double click bug in PingClickHandler by clearing blinking flag early
This commit is contained in:
@@ -96,6 +96,10 @@ public class PingClickHandler : MonoBehaviour
|
|||||||
if (hit.collider != null && hit.collider.gameObject == gameObject)
|
if (hit.collider != null && hit.collider.gameObject == gameObject)
|
||||||
{
|
{
|
||||||
Debug.Log($"[PingClick] Update手动射线贯穿点中 (使用相机: {c.name}): {name}");
|
Debug.Log($"[PingClick] Update手动射线贯穿点中 (使用相机: {c.name}): {name}");
|
||||||
|
|
||||||
|
// FIX BUG: Prevent multiple clicks in the same frame
|
||||||
|
_isBlinking = false;
|
||||||
|
|
||||||
PerformClick();
|
PerformClick();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -106,12 +110,6 @@ public class PingClickHandler : MonoBehaviour
|
|||||||
|
|
||||||
public void PerformClick()
|
public void PerformClick()
|
||||||
{
|
{
|
||||||
if (!_isBlinking)
|
|
||||||
{
|
|
||||||
Debug.Log($"[PingClick] {name} 忽略点击,因为 _isBlinking=false");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_modelShown)
|
if (!_modelShown)
|
||||||
{
|
{
|
||||||
_modelShown = true;
|
_modelShown = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user