Я новичок и не знаю как сделать. Сделал код для работы с 1 стороны. Думаю можно ли через аниматор или нет?
вот код
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class ControllerPressing : MonoBehaviour, IPointerDownHandler, IPointerUpHandler
{
public Animation anim;
public MeshCollider colliderdestroyed;
public void Awake()
{
anim = GetComponent<Animation>();
}
public void OnPointerDown(PointerEventData eventData)
{
}
public void OnPointerUp(PointerEventData eventData)
{
anim.Play();
MeshCollider.Destroy(colliderdestroyed);
}
}