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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View file

@ -0,0 +1,120 @@
fileFormatVersion: 2
guid: 66efa60411c6d844da0331543683d5d8
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 72
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -3862,7 +3862,7 @@ RectTransform:
- {fileID: 424396917}
- {fileID: 117889363}
m_Father: {fileID: 1852819573}
m_RootOrder: 3
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
@ -7992,7 +7992,7 @@ RectTransform:
m_Children:
- {fileID: 2037220114}
m_Father: {fileID: 1852819573}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5}
@ -8515,8 +8515,8 @@ RectTransform:
- {fileID: 238901181}
- {fileID: 1527251880}
- {fileID: 689207020}
- {fileID: 770589360}
- {fileID: 1747224096}
- {fileID: 770589360}
- {fileID: 580861938}
- {fileID: 1838356727}
- {fileID: 411779174}

View file

@ -166,7 +166,7 @@ namespace RhythmHeavenMania
public bool NotStopped()
{
return Conductor.instance.isPlaying == true || Conductor.instance.isPaused;
return Conductor.instance.isPlaying == true || Conductor.instance.isPaused == true;
}
}
}

View file

@ -36,6 +36,12 @@ namespace RhythmHeavenMania
loadedScene = 0;
fadeDuration = 0;
GameObject ui = new GameObject();
ui.AddComponent<SpriteRenderer>().sprite = Resources.Load<Sprite>("tempBuildUI");
ui.GetComponent<SpriteRenderer>().sortingOrder = 32767;
ui.layer = 5;
ui.name = "tempBuildUI";
}
public void Awake()

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"