MiniGames/Assets/JumpHoldImage.cs
2025-09-12 10:08:01 +05:00

20 lines
478 B
C#

using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
[RequireComponent(typeof(Image))]
public class JumpHoldImage : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public ChasePlayerController player;
public void OnPointerDown(PointerEventData eventData)
{
if (player != null) player.OnJumpPress();
}
public void OnPointerUp(PointerEventData eventData)
{
if (player != null) player.OnJumpRelease();
}
}