Add hand
This commit is contained in:
27
Assets/Oculus Hands/Scripts/AnimationHandOnInout.cs
Normal file
27
Assets/Oculus Hands/Scripts/AnimationHandOnInout.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
|
||||
public class AnimationHandOnInout : MonoBehaviour
|
||||
{
|
||||
public InputActionProperty pinchAnimationAction;
|
||||
public InputActionProperty gripAnimationAction;
|
||||
public Animator handAnimator;
|
||||
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
float triggerValue = pinchAnimationAction.action.ReadValue<float>();
|
||||
handAnimator.SetFloat("Trigger", triggerValue);
|
||||
|
||||
float gripValue = gripAnimationAction.action.ReadValue<float>();
|
||||
handAnimator.SetFloat("Grip", gripValue);
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user