20 lines
478 B
C#
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();
|
|
}
|
|
}
|