You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.0 KiB
32 lines
1.0 KiB
|
1 month ago
|
using NaughtyAttributes;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace UDE_HAND_INTERACTION
|
||
|
|
{
|
||
|
|
public class FingerPressSelector : MonoBehaviour
|
||
|
|
{
|
||
|
|
[SerializeField, BoxGroup("Active Fingers Selection")]
|
||
|
|
private bool ThumbActive;
|
||
|
|
[SerializeField, BoxGroup("Active Fingers Selection")]
|
||
|
|
private bool IndexActive;
|
||
|
|
[SerializeField, BoxGroup("Active Fingers Selection")]
|
||
|
|
private bool MiddleActive;
|
||
|
|
[SerializeField, BoxGroup("Active Fingers Selection")]
|
||
|
|
private bool RingActive;
|
||
|
|
[SerializeField, BoxGroup("Active Fingers Selection")]
|
||
|
|
private bool PinkyActive;
|
||
|
|
|
||
|
|
private Transform PressFingers => transform.Find("FingerPress");
|
||
|
|
private bool[] fingers;
|
||
|
|
|
||
|
|
private void Update()
|
||
|
|
{
|
||
|
|
fingers = new bool[5] { ThumbActive, IndexActive, MiddleActive, RingActive, PinkyActive };
|
||
|
|
for (int i = 0; i < 5; ++i)
|
||
|
|
{
|
||
|
|
PressFingers.GetChild(i).gameObject.SetActive(fingers[i]);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|