Звук машин
This commit is contained in:
28
Assets/Crossy Road VR/Scripts/AnimateHandOnInputScript.cs
Normal file
28
Assets/Crossy Road VR/Scripts/AnimateHandOnInputScript.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class AnimateHandOnInputScript : MonoBehaviour
|
||||
{
|
||||
public InputActionProperty PinchAnimationAction;
|
||||
public InputActionProperty GripAnimationAction;
|
||||
|
||||
public Animator HandAnimator;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
float tiggerValue = PinchAnimationAction.action.ReadValue<float>();
|
||||
HandAnimator.SetFloat("Trigger", tiggerValue);
|
||||
|
||||
float gripValue = GripAnimationAction.action.ReadValue<float>();
|
||||
HandAnimator.SetFloat("Grip", gripValue);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user