This commit is contained in:
Gerard Gascón 2025-04-24 17:02:43 +02:00
commit fca6784fe7
571 changed files with 84105 additions and 0 deletions

View file

@ -0,0 +1,34 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class Finger : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler{
[SerializeField, Range(1, 5)] int fingerIndex = 1;
bool selected;
HandManager hand;
void Awake(){
hand = GetComponentInParent<HandManager>();
}
public void OnPointerEnter(PointerEventData eventData){
selected = true;
}
public void OnPointerExit(PointerEventData eventData){
selected = false;
}
// Update is called once per frame
void Update(){
if (selected){
if (Input.GetMouseButtonDown(0)){
hand.Cut(fingerIndex);
//gameObject.SetActive(false);
}
}
}
}