HeavenStudioPlus/Assets/Scripts/Games/MrUpbeat/MrUpbeat.cs
Carson Kompon 063c144e44 Mr Upbeat Programming progress
Autoplay works but it doesn't work otherwise
2022-03-04 17:03:57 -05:00

54 lines
No EOL
1.3 KiB
C#

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;
public UpbeatMan man;
public float nextBeat;
public bool canGo = false;
public static MrUpbeat instance;
private void Awake()
{
instance = this;
}
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;
}
}
}