Some DJ School logic and animations, DJ Yellow is not currently animatable.

This commit is contained in:
Braedon
2022-02-04 22:48:35 -05:00
parent c91d306a41
commit 7a624d0581
46 changed files with 3062 additions and 41 deletions

View File

@ -1,9 +1,17 @@
using UnityEngine;
using RhythmHeavenMania.Util;
namespace RhythmHeavenMania.Games.DJSchool
{
public class DJSchool : Minigame
{
[Header("Components")]
[SerializeField] private Student student;
[Header("Properties")]
public GameEvent bop = new GameEvent();
public static DJSchool instance { get; private set; }
private void Awake()
@ -11,6 +19,33 @@ namespace RhythmHeavenMania.Games.DJSchool
instance = this;
}
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;
}
public void BreakCmon(float beat)
{
MultiSound.Play(new MultiSound.Sound[]
@ -19,6 +54,9 @@ namespace RhythmHeavenMania.Games.DJSchool
new MultiSound.Sound("djSchool/breakCmon2", beat + 1f),
new MultiSound.Sound("djSchool/ooh", beat + 2f),
});
student.holdBeat = beat;
student.ResetState();
}
public void ScratchoHey(float beat)
@ -29,6 +67,9 @@ namespace RhythmHeavenMania.Games.DJSchool
new MultiSound.Sound("djSchool/scratchoHey2", beat + 1f),
new MultiSound.Sound("djSchool/hey", beat + 2f),
});
student.swipeBeat = beat;
student.ResetState();
}
}
}