HeavenStudioPlus/Assets/Scripts/Games/TapTrial/TapTrialPlayer.cs

31 lines
627 B
C#
Raw Normal View History

2022-02-19 21:03:45 +00:00
using UnityEngine;
2022-02-28 07:05:57 +00:00
using RhythmHeavenMania.Util;
2022-02-19 21:03:45 +00:00
namespace RhythmHeavenMania.Games.TapTrial
{
public class TapTrialPlayer : MonoBehaviour
{
[Header("References")]
[System.NonSerialized] public Animator anim;
private void Start()
{
anim = GetComponent<Animator>();
}
2022-02-28 07:05:57 +00:00
private void Update()
{
if (PlayerInput.Pressed())
{
Tap(false);
}
}
public void Tap(bool hit)
{
2022-02-28 15:36:05 +00:00
Jukebox.PlayOneShotGame("tapTrial/tonk");
2022-02-28 07:05:57 +00:00
anim.Play("Tap", 0, 0);
}
2022-02-19 21:03:45 +00:00
}
}