using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.EventSystems;

public class ToyotaPalancasController : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
    public bool accion = false;
    public UnityEvent eventOnAccioning;
    public UnityEvent eventOnOffAccioning;

    public void OnPointerDown(PointerEventData eventData)
    {
        this.accion = true;
    }

    public void OnPointerUp(PointerEventData eventData)
    {
        this.accion = false;
    }

    private void Update()
    {
        if (this.accion)
        {
            this.eventOnAccioning.Invoke();
        }
        else
        {
            this.eventOnOffAccioning.Invoke();
        }
    }
}
