Fixed some play and pause bugs in the editor

This commit is contained in:
Braedon
2022-01-16 21:31:49 -05:00
parent 61f3c423fe
commit e735f1ccaf
11 changed files with 165 additions and 13 deletions

View File

@ -40,6 +40,15 @@ namespace RhythmHeavenMania.Editor
return;
}
if (Conductor.instance.NotStopped())
{
startPosition = Vector2.zero;
endPosition = Vector2.zero;
DrawVisual();
SelectEvents();
return;
}
// click
if (Input.GetMouseButtonDown(0))
{

View File

@ -92,13 +92,14 @@ namespace RhythmHeavenMania.Editor
public void SelectGame(string gameName, int index)
{
mg = EventCaller.instance.minigames.Find(c => c.displayName == gameName);
transform.GetChild(index).GetChild(0).gameObject.SetActive(true);
SelectedMinigame = gameName;
gameOpen = true;
DestroyEvents();
AddEvents();
transform.GetChild(index).GetChild(0).gameObject.SetActive(true);
currentEventIndex = 0;
UpdateIndex(0, false);

View File

@ -66,8 +66,17 @@ namespace RhythmHeavenMania.Editor
else
PlayCheck(true);
});
PauseBTN.onClick.AddListener(delegate { PlayCheck(false); });
StopBTN.onClick.AddListener(delegate { PlayCheck(true); });
PauseBTN.onClick.AddListener(delegate
{
if (Conductor.instance.isPlaying && !Conductor.instance.isPaused)
PlayCheck(false);
});
StopBTN.onClick.AddListener(delegate
{
if (Conductor.instance.isPlaying || Conductor.instance.isPaused)
PlayCheck(true);
});
MetronomeBTN.onClick.AddListener(delegate
{
if (!Conductor.instance.metronome)
@ -164,7 +173,7 @@ namespace RhythmHeavenMania.Editor
{
if (fromStart)
{
if (!Conductor.instance.isPlaying)
if (!Conductor.instance.isPlaying && !Conductor.instance.isPaused)
{
Play(false, TimelineSlider.transform.localPosition.x);
}
@ -178,9 +187,16 @@ namespace RhythmHeavenMania.Editor
{
if (!Conductor.instance.isPlaying)
{
Play(false, TimelineSongPosLine.transform.localPosition.x);
if (TimelineSongPosLine == null)
{
Play(false, TimelineSlider.transform.localPosition.x);
}
else
{
Play(false, TimelineSongPosLine.transform.localPosition.x);
}
}
else
else if (!Conductor.instance.isPaused)
{
Pause();
}

View File

@ -13,11 +13,11 @@
"Layer3Col": "06d6a0",
"Layer4Col": "118ab2",
"EventSelectedCol": "ffbc36",
"EventSelectedCol": "61e5ff",
"EventNormalCol": "FFFFFF",
"BeatMarkerCol": "ffbc36",
"CurrentTimeMarkerCol": "ffc95c",
"BeatMarkerCol": "61e5ff",
"CurrentTimeMarkerCol": "61e5ff",
"BoxSelectionCol": "61e5ff",
"BoxSelectionOutlineCol": "61e5ff"