28 lines
632 B
C#
28 lines
632 B
C#
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);
|
|
|
|
}
|
|
}
|