mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 11:17:38 +02:00
Some DJ School logic and animations, DJ Yellow is not currently animatable.
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user