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,42 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class FingerHandManager : MonoBehaviour, IDropHandler{
[SerializeField, Range(1, 5)] int fingerIndex = 1;
public void OnDrop(PointerEventData eventData){
if(eventData.pointerDrag != null){
FakeFingerManager finger = eventData.pointerDrag.GetComponent<FakeFingerManager>();
finger.setPos = true;
//finger.posToGo = GetComponent<RectTransform>().anchoredPosition;
finger.dragging = false;
finger.index = fingerIndex;
HandManager hand = GetComponentInParent<HandManager>();
switch (fingerIndex){
case 1:
hand.finger1 = true;
hand.finger1Type = finger.fingerType;
break;
case 2:
hand.finger2 = true;
hand.finger2Type = finger.fingerType;
break;
case 3:
hand.finger3 = true;
hand.finger3Type = finger.fingerType;
break;
case 4:
hand.finger4 = true;
hand.finger4Type = finger.fingerType;
break;
case 5:
hand.finger5 = true;
hand.finger5Type = finger.fingerType;
break;
}
}
}
}