2022-02-05 03:48:35 +00:00
|
|
|
using UnityEngine;
|
|
|
|
|
2022-02-03 02:09:50 +00:00
|
|
|
using RhythmHeavenMania.Util;
|
|
|
|
|
|
|
|
namespace RhythmHeavenMania.Games.DJSchool
|
|
|
|
{
|
|
|
|
public class DJSchool : Minigame
|
|
|
|
{
|
2022-02-05 03:48:35 +00:00
|
|
|
[Header("Components")]
|
|
|
|
[SerializeField] private Student student;
|
|
|
|
|
|
|
|
[Header("Properties")]
|
|
|
|
public GameEvent bop = new GameEvent();
|
|
|
|
|
2022-02-03 02:09:50 +00:00
|
|
|
public static DJSchool instance { get; private set; }
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
{
|
|
|
|
instance = this;
|
|
|
|
}
|
|
|
|
|
2022-02-05 03:48:35 +00:00
|
|
|
private void Update()
|
|
|
|
{
|
|
|
|
if (Conductor.instance.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
|
|
|
|
{
|
|
|
|
if (Conductor.instance.songPositionInBeats >= bop.startBeat && Conductor.instance.songPositionInBeats < bop.startBeat + bop.length)
|
|
|
|
{
|
|
|
|
if (student.anim.IsAnimationNotPlaying())
|
|
|
|
{
|
|
|
|
if (student.isHolding)
|
|
|
|
{
|
|
|
|
student.anim.Play("HoldBop", 0, 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
student.anim.Play("IdleBop", 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public void Bop(float beat, float length)
|
|
|
|
{
|
|
|
|
bop.startBeat = beat;
|
|
|
|
bop.length = length;
|
|
|
|
}
|
|
|
|
|
2022-02-03 02:09:50 +00:00
|
|
|
public void BreakCmon(float beat)
|
|
|
|
{
|
|
|
|
MultiSound.Play(new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound("djSchool/breakCmon1", beat),
|
|
|
|
new MultiSound.Sound("djSchool/breakCmon2", beat + 1f),
|
|
|
|
new MultiSound.Sound("djSchool/ooh", beat + 2f),
|
|
|
|
});
|
2022-02-05 03:48:35 +00:00
|
|
|
|
|
|
|
student.holdBeat = beat;
|
|
|
|
student.ResetState();
|
2022-02-03 02:09:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public void ScratchoHey(float beat)
|
|
|
|
{
|
|
|
|
MultiSound.Play(new MultiSound.Sound[]
|
|
|
|
{
|
|
|
|
new MultiSound.Sound("djSchool/scratchoHey1", beat),
|
|
|
|
new MultiSound.Sound("djSchool/scratchoHey2", beat + 1f),
|
|
|
|
new MultiSound.Sound("djSchool/hey", beat + 2f),
|
|
|
|
});
|
2022-02-05 03:48:35 +00:00
|
|
|
|
|
|
|
student.swipeBeat = beat;
|
|
|
|
student.ResetState();
|
2022-02-03 02:09:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|