HeavenStudioPlus/Assets/Scripts/Games/RhythmTweezers/Hair.cs

40 lines
953 B
C#
Raw Normal View History

2022-02-09 03:58:25 +00:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace RhythmHeavenMania.Games.RhythmTweezers
{
public class Hair : PlayerActionObject
{
public float createBeat;
private RhythmTweezers game;
2022-02-09 06:52:50 +00:00
private Tweezers tweezers;
private void Awake()
{
game = RhythmTweezers.instance;
tweezers = game.Tweezers;
2022-02-09 06:52:50 +00:00
}
2022-02-09 03:58:25 +00:00
private void Update()
{
float stateBeat = Conductor.instance.GetPositionFromBeat(createBeat + game.tweezerBeatOffset, game.beatInterval);
2022-02-09 03:58:25 +00:00
StateCheck(stateBeat);
2022-02-09 06:52:50 +00:00
if (PlayerInput.Pressed() && tweezers.hitOnFrame == 0)
2022-02-09 03:58:25 +00:00
{
if (state.perfect)
{
Ace();
}
}
}
public void Ace()
{
tweezers.Pluck(true, this);
tweezers.hitOnFrame++;
}
}
}