mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 13:37:40 +02:00
Added Mr. Upbeat fall animation
This commit is contained in:
@ -17,7 +17,7 @@ namespace RhythmHeavenMania.Games.MrUpbeat
|
||||
public GameEvent beat = new GameEvent();
|
||||
public GameEvent offbeat = new GameEvent();
|
||||
public bool canGo = false;
|
||||
private int beatCount = 0;
|
||||
public int beatCount = 0;
|
||||
|
||||
public static MrUpbeat instance;
|
||||
|
||||
@ -26,13 +26,15 @@ namespace RhythmHeavenMania.Games.MrUpbeat
|
||||
instance = this;
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
canGo = false;
|
||||
man.stepTimes = 0;
|
||||
SetInterval(0);
|
||||
}
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (canGo)
|
||||
metronome.transform.eulerAngles = new Vector3(0, 0, 270 - Mathf.Cos(Mathf.PI * Conductor.instance.songPositionInBeats) * 75);
|
||||
//else
|
||||
// metronome.transform.eulerAngles = new Vector3(0, 0, 200);
|
||||
|
||||
List<Beatmap.Entity> gos = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "mrUpbeat/go");
|
||||
for(int i=0; i<gos.Count; i++)
|
||||
{
|
||||
@ -46,6 +48,11 @@ namespace RhythmHeavenMania.Games.MrUpbeat
|
||||
}
|
||||
}
|
||||
|
||||
if (canGo)
|
||||
{
|
||||
metronome.transform.eulerAngles = new Vector3(0, 0, 270 - Mathf.Cos(Mathf.PI * Conductor.instance.songPositionInBeats) * 75);
|
||||
}
|
||||
|
||||
if (Conductor.instance.ReportBeat(ref beat.lastReportedBeat) && canGo)
|
||||
{
|
||||
if(beatCount % 2 == 0)
|
||||
@ -63,14 +70,6 @@ namespace RhythmHeavenMania.Games.MrUpbeat
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnGameSwitch()
|
||||
{
|
||||
base.OnGameSwitch();
|
||||
canGo = false;
|
||||
man.stepTimes = 0;
|
||||
SetInterval(0);
|
||||
}
|
||||
|
||||
public void SetInterval(float beat)
|
||||
{
|
||||
beatCount = 0;
|
||||
|
@ -29,7 +29,10 @@ namespace RhythmHeavenMania.Games.MrUpbeat
|
||||
|
||||
if(game.canGo && normalizedBeat > Minigame.LateTime())
|
||||
{
|
||||
//Fall();
|
||||
if ((game.beatCount % 2 == 0 && stepTimes % 2 == 0) || (game.beatCount % 2 == 1 && stepTimes % 2 == 1))
|
||||
{
|
||||
Fall();
|
||||
}
|
||||
targetBeat += 100f;
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user