2022-03-04 20:47:40 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using System;
|
|
|
|
using Starpelly;
|
|
|
|
|
|
|
|
using RhythmHeavenMania.Util;
|
|
|
|
|
|
|
|
namespace RhythmHeavenMania.Games.MrUpbeat
|
|
|
|
{
|
|
|
|
public class MrUpbeat : Minigame
|
|
|
|
{
|
|
|
|
[Header("References")]
|
|
|
|
public GameObject metronome;
|
2022-03-04 22:03:57 +00:00
|
|
|
public UpbeatMan man;
|
|
|
|
|
|
|
|
public float nextBeat;
|
|
|
|
public bool canGo = false;
|
|
|
|
|
2022-03-04 20:47:40 +00:00
|
|
|
|
|
|
|
public static MrUpbeat instance;
|
|
|
|
|
|
|
|
private void Awake()
|
|
|
|
{
|
|
|
|
instance = this;
|
|
|
|
}
|
|
|
|
|
2022-03-04 22:03:57 +00:00
|
|
|
private void Update()
|
|
|
|
{
|
|
|
|
List<Beatmap.Entity> gos = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "mrUpbeat/go");
|
|
|
|
for(int i=0; i<gos.Count; i++)
|
|
|
|
{
|
|
|
|
if ((gos[i].beat - 0.15f) <= Conductor.instance.songPositionInBeats && (gos[i].beat + gos[i].length) - 0.15f > Conductor.instance.songPositionInBeats)
|
|
|
|
{
|
|
|
|
canGo = true;
|
|
|
|
break;
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
canGo = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
float normalizedBeat = Conductor.instance.GetPositionFromBeat(nextBeat, 0.5f);
|
|
|
|
//StateCheck(normalizedBeat);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void SetInterval(float beat)
|
|
|
|
{
|
|
|
|
nextBeat = beat;
|
|
|
|
}
|
2022-03-04 20:47:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|