Tempo change? (Don't update very buggy)

This commit is contained in:
Braedon 2022-01-27 21:50:57 -05:00
parent 8f268f4d60
commit 9185249dd1
36 changed files with 2630 additions and 39 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 517 B

View file

@ -0,0 +1,120 @@
fileFormatVersion: 2
guid: d9e16d1a9c755fb4eaee2c9dde5c90ce
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: 0
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: 100
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: 0
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: 0
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: 0
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:

Binary file not shown.

After

Width:  |  Height:  |  Size: 476 B

View file

@ -0,0 +1,120 @@
fileFormatVersion: 2
guid: e981b58e3e8bac4419e2d70f6a1406bb
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: 0
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: 100
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: 0
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: 0
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: 0
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:

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 B

View file

@ -0,0 +1,120 @@
fileFormatVersion: 2
guid: 4175d83ff0c404f41adbfe1936e9801c
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: 0
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: 100
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: 0
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: 0
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: 0
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:

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View file

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: a1e215e768b7d1b4e93a60f8ce9c10fc
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: 100
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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,120 @@
fileFormatVersion: 2
guid: 6e7b88d9d62ed1b429c63b83745e3672
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: 100
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:

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View file

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 44c391c5df20f2844b9437c0f3138355
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: 100
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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: b29210cf5b7b8234984ec842a3110005
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: 100
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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load diff

View file

@ -9,6 +9,7 @@ namespace RhythmHeavenMania
{ {
public float bpm; public float bpm;
public List<Entity> entities = new List<Entity>(); public List<Entity> entities = new List<Entity>();
public List<TempoChange> tempoChanges = new List<TempoChange>();
[Serializable] [Serializable]
public class Entity : ICloneable public class Entity : ICloneable
@ -19,7 +20,20 @@ namespace RhythmHeavenMania
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valA; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public float valA;
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public int type; [JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)] public int type;
public string datamodel; public string datamodel;
[JsonIgnore] public Editor.TimelineEventObj eventObj; [JsonIgnore] public Editor.Track.TimelineEventObj eventObj;
public object Clone()
{
return this.MemberwiseClone();
}
}
[Serializable]
public class TempoChange : ICloneable
{
public float beat;
public float length;
public float tempo;
public object Clone() public object Clone()
{ {

View file

@ -47,6 +47,8 @@ namespace RhythmHeavenMania
// Metronome tick sound enabled // Metronome tick sound enabled
public bool metronome = false; public bool metronome = false;
public float timeSinceLastTempoChange = 0;
private bool beat; private bool beat;
// private AudioDspTimeKeeper timeKeeper; // private AudioDspTimeKeeper timeKeeper;
@ -56,11 +58,6 @@ namespace RhythmHeavenMania
instance = this; instance = this;
} }
void Start()
{
secPerBeat = 60f / songBpm;
}
public void SetBeat(float beat) public void SetBeat(float beat)
{ {
float secFromBeat = GetSongPosFromBeat(beat); float secFromBeat = GetSongPosFromBeat(beat);
@ -79,6 +76,7 @@ namespace RhythmHeavenMania
public void Play(float beat) public void Play(float beat)
{ {
this.time = GetSongPosFromBeat(beat); this.time = GetSongPosFromBeat(beat);
songPositionInBeats = GetSongPosFromBeat(beat) / secPerBeat;
isPlaying = true; isPlaying = true;
isPaused = false; isPaused = false;
@ -103,22 +101,27 @@ namespace RhythmHeavenMania
public void Stop(float time) public void Stop(float time)
{ {
this.time = time; this.time = time;
songPositionInBeats = time / secPerBeat;
isPlaying = false; isPlaying = false;
isPaused = false; isPaused = false;
musicSource.Stop(); musicSource.Stop();
} }
float test;
public void Update() public void Update()
{ {
secPerBeat = 60f / songBpm;
if (isPlaying) if (isPlaying)
{ {
time += Time.deltaTime * musicSource.pitch; time += Time.deltaTime * musicSource.pitch;
songPosition = time - firstBeatOffset; songPosition = time - firstBeatOffset;
songPositionInBeats = songPosition / secPerBeat; songPositionInBeats += (Time.deltaTime - firstBeatOffset) / secPerBeat;
// songPositionInBeats = Time.deltaTime / secPerBeat;
if (metronome) if (metronome)
{ {

View file

@ -32,7 +32,7 @@ namespace RhythmHeavenMania
[Header("Properties")] [Header("Properties")]
public int currentEvent, currentPlayerEvent; public int currentEvent, currentTempoEvent;
public float startOffset; public float startOffset;
public bool playOnStart; public bool playOnStart;
public float startBeat; public float startBeat;
@ -93,6 +93,7 @@ namespace RhythmHeavenMania
return; return;
List<float> entities = Beatmap.entities.Select(c => c.beat).ToList(); List<float> entities = Beatmap.entities.Select(c => c.beat).ToList();
List<float> tempoChanges = Beatmap.tempoChanges.Select(c => c.beat).ToList();
if (currentEvent < Beatmap.entities.Count && currentEvent >= 0) if (currentEvent < Beatmap.entities.Count && currentEvent >= 0)
{ {
@ -122,6 +123,16 @@ namespace RhythmHeavenMania
currentEvent += entitesAtSameBeat.Count + gameManagerEntities.Count; currentEvent += entitesAtSameBeat.Count + gameManagerEntities.Count;
} }
} }
if (currentTempoEvent < Beatmap.tempoChanges.Count && currentTempoEvent >= 0)
{
if (Conductor.instance.songPositionInBeats >= tempoChanges[currentTempoEvent])
{
Conductor.instance.songBpm = Beatmap.tempoChanges[currentTempoEvent].tempo;
Conductor.instance.timeSinceLastTempoChange = Time.time;
currentTempoEvent++;
}
}
} }
#region Play Events #region Play Events
@ -135,6 +146,9 @@ namespace RhythmHeavenMania
{ {
yield return null; yield return null;
bool paused = Conductor.instance.isPaused; bool paused = Conductor.instance.isPaused;
Conductor.instance.SetBpm(Beatmap.bpm);
Conductor.instance.Play(beat); Conductor.instance.Play(beat);
if (!paused) if (!paused)
{ {
@ -162,6 +176,7 @@ namespace RhythmHeavenMania
public void SortEventsList() public void SortEventsList()
{ {
Beatmap.entities.Sort((x, y) => x.beat.CompareTo(y.beat)); Beatmap.entities.Sort((x, y) => x.beat.CompareTo(y.beat));
Beatmap.tempoChanges.Sort((x, y) => x.beat.CompareTo(y.beat));
} }
public void SetCurrentEventToClosest(float beat) public void SetCurrentEventToClosest(float beat)
@ -170,11 +185,6 @@ namespace RhythmHeavenMania
if (Beatmap.entities.Count > 0) if (Beatmap.entities.Count > 0)
{ {
List<float> entities = Beatmap.entities.Select(c => c.beat).ToList(); List<float> entities = Beatmap.entities.Select(c => c.beat).ToList();
if (playerEntities != null)
{
List<float> entities_p = playerEntities.Select(c => c.beat).ToList();
currentPlayerEvent = entities_p.IndexOf(Mathp.GetClosestInList(entities_p, beat));
}
currentEvent = entities.IndexOf(Mathp.GetClosestInList(entities, beat)); currentEvent = entities.IndexOf(Mathp.GetClosestInList(entities, beat));
@ -206,6 +216,13 @@ namespace RhythmHeavenMania
SetGame(newGame); SetGame(newGame);
} }
if (Beatmap.tempoChanges.Count > 0)
{
List<float> tempoChanges = Beatmap.tempoChanges.Select(c => c.beat).ToList();
currentTempoEvent = tempoChanges.IndexOf(Mathp.GetClosestInList(tempoChanges, beat));
}
} }
#endregion #endregion

View file

@ -2,6 +2,8 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using RhythmHeavenMania.Editor.Track;
namespace RhythmHeavenMania.Games namespace RhythmHeavenMania.Games
{ {
public class PlayerActionObject : MonoBehaviour public class PlayerActionObject : MonoBehaviour
@ -150,9 +152,9 @@ namespace RhythmHeavenMania.Games
private void AceVisuals() private void AceVisuals()
{ {
if (Editor.Timeline.instance != null) if (Timeline.instance != null)
{ {
Editor.Timeline.instance.AutoplayBTN.GetComponent<Animator>().Play("Ace", 0, 0); Timeline.instance.AutoplayBTN.GetComponent<Animator>().Play("Ace", 0, 0);
} }
} }

View file

@ -5,6 +5,8 @@ using UnityEngine.UI;
using Starpelly; using Starpelly;
using RhythmHeavenMania.Editor.Track;
namespace RhythmHeavenMania.Editor namespace RhythmHeavenMania.Editor
{ {
public class BoxSelection : MonoBehaviour public class BoxSelection : MonoBehaviour

View file

@ -3,11 +3,14 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
using RhythmHeavenMania.Editor.Track;
namespace RhythmHeavenMania.Editor.Commands namespace RhythmHeavenMania.Editor.Commands
{ {
public class Selection : IAction public class Selection : IAction
{ {
List<TimelineEventObj> eventObjs; List<TimelineEventObj> eventObjs;
List<TimelineEventObj> lastEventObjs;
public Selection(List<TimelineEventObj> eventObjs) public Selection(List<TimelineEventObj> eventObjs)
{ {
@ -20,14 +23,15 @@ namespace RhythmHeavenMania.Editor.Commands
public void Redo() public void Redo()
{ {
for (int i = 0; i < eventObjs.Count; i++) for (int i = 0; i < lastEventObjs.Count; i++)
{ {
Selections.instance.ShiftClickSelect(eventObjs[i]); Selections.instance.ShiftClickSelect(lastEventObjs[i]);
} }
} }
public void Undo() public void Undo()
{ {
lastEventObjs = eventObjs;
for (int i = 0; i < eventObjs.Count; i++) for (int i = 0; i < eventObjs.Count; i++)
{ {
Selections.instance.ShiftClickSelect(eventObjs[i]); Selections.instance.ShiftClickSelect(eventObjs[i]);
@ -102,6 +106,7 @@ namespace RhythmHeavenMania.Editor.Commands
public class Place : IAction public class Place : IAction
{ {
TimelineEventObj eventObj; TimelineEventObj eventObj;
TimelineEventObj deletedObj;
public Place(TimelineEventObj eventObj) public Place(TimelineEventObj eventObj)
{ {
@ -114,11 +119,12 @@ namespace RhythmHeavenMania.Editor.Commands
public void Redo() public void Redo()
{ {
throw new System.NotImplementedException(); deletedObj = Timeline.instance.AddEventObject(deletedObj.entity.datamodel, false, new Vector3(deletedObj.entity.beat, -deletedObj.entity.track * Timeline.instance.LayerHeight()), deletedObj.entity, true, deletedObj.entity.eventObj.eventObjID);
} }
public void Undo() public void Undo()
{ {
deletedObj = eventObj;
Selections.instance.Deselect(eventObj); Selections.instance.Deselect(eventObj);
Timeline.instance.DestroyEventObject(eventObj.entity); Timeline.instance.DestroyEventObject(eventObj.entity);
// Beatmap.Entity e = deletedObjs[i].entity; // Beatmap.Entity e = deletedObjs[i].entity;

View file

@ -8,6 +8,8 @@ using Newtonsoft.Json;
using TMPro; using TMPro;
using Starpelly; using Starpelly;
using RhythmHeavenMania.Editor.Track;
namespace RhythmHeavenMania.Editor namespace RhythmHeavenMania.Editor
{ {
public class Editor : MonoBehaviour public class Editor : MonoBehaviour
@ -124,8 +126,11 @@ namespace RhythmHeavenMania.Editor
List<TimelineEventObj> result = new List<TimelineEventObj>(); List<TimelineEventObj> result = new List<TimelineEventObj>();
for (int i = 0; i < selectedEvents.Count; i++) for (int i = 0; i < selectedEvents.Count; i++)
{
if (selectedEvents[i].isCreating == false)
{ {
result.Add(selectedEvents[i]); result.Add(selectedEvents[i]);
}
selectedEvents[i].OnUp(); selectedEvents[i].OnUp();
} }
CommandManager.instance.Execute(new Commands.Move(result)); CommandManager.instance.Execute(new Commands.Move(result));

View file

@ -8,6 +8,8 @@ using TMPro;
using Starpelly; using Starpelly;
using RhythmHeavenMania.Editor.Track;
namespace RhythmHeavenMania.Editor namespace RhythmHeavenMania.Editor
{ {
public class EditorTheme : MonoBehaviour public class EditorTheme : MonoBehaviour

View file

@ -7,6 +7,8 @@ using TMPro;
using DG.Tweening; using DG.Tweening;
using Starpelly; using Starpelly;
using RhythmHeavenMania.Editor.Track;
namespace RhythmHeavenMania.Editor namespace RhythmHeavenMania.Editor
{ {
public class GridGameSelector : MonoBehaviour public class GridGameSelector : MonoBehaviour
@ -170,7 +172,10 @@ namespace RhythmHeavenMania.Editor
{ {
eventObj = Timeline.instance.AddEventObject(mg.name + "/" + mg.actions[currentEventIndex - 1].actionName, true, new Vector3(0, 0), null, true, Timeline.RandomID()); eventObj = Timeline.instance.AddEventObject(mg.name + "/" + mg.actions[currentEventIndex - 1].actionName, true, new Vector3(0, 0), null, true, Timeline.RandomID());
} }
CommandManager.instance.Execute(new Commands.Place(eventObj));
eventObj.isCreating = true;
// CommandManager.instance.Execute(new Commands.Place(eventObj));
} }
} }

View file

@ -3,6 +3,8 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using UnityEngine; using UnityEngine;
using RhythmHeavenMania.Editor.Track;
namespace RhythmHeavenMania.Editor namespace RhythmHeavenMania.Editor
{ {
public class Selections : MonoBehaviour public class Selections : MonoBehaviour

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2421c88054c4eb742b45be7075dd450c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,56 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using Starpelly;
namespace RhythmHeavenMania.Editor.Track
{
public class TempoTimeline : MonoBehaviour
{
[Header("Components")]
private RectTransform rectTransform;
[SerializeField] private RectTransform RefTempoChange;
private void Start()
{
rectTransform = this.GetComponent<RectTransform>();
}
private void Update()
{
if (RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Camera.main))
{
if (Input.GetMouseButtonDown(0))
{
AddTempoChange();
}
}
}
private void AddTempoChange()
{
GameObject tempoChange = Instantiate(RefTempoChange.gameObject, this.transform);
tempoChange.transform.GetChild(0).GetComponent<Image>().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB();
tempoChange.transform.GetChild(1).GetComponent<Image>().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB();
tempoChange.transform.GetChild(2).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB();
tempoChange.SetActive(true);
tempoChange.transform.position = new Vector3(Camera.main.ScreenToWorldPoint(Input.mousePosition).x, tempoChange.transform.position.y);
tempoChange.transform.localPosition = new Vector3(Starpelly.Mathp.Round2Nearest(tempoChange.transform.localPosition.x, 0.25f), tempoChange.transform.localPosition.y);
TempoTimelineObj tempoTimelineObj = tempoChange.AddComponent<TempoTimelineObj>();
Beatmap.TempoChange tempoC = new Beatmap.TempoChange();
tempoC.beat = tempoChange.transform.localPosition.x;
tempoC.tempo = GameManager.instance.Beatmap.bpm;
tempoTimelineObj.tempoChange = tempoC;
GameManager.instance.Beatmap.tempoChanges.Add(tempoC);
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 10dd19278a802c24fbeb39d1ccb23219
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,45 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
namespace RhythmHeavenMania.Editor.Track
{
public class TempoTimelineObj : MonoBehaviour
{
[Header("Components")]
[SerializeField] private RectTransform rectTransform;
[SerializeField] private TMP_Text tempoTXT;
public Beatmap.TempoChange tempoChange;
private void Start()
{
rectTransform = GetComponent<RectTransform>();
tempoTXT = transform.GetChild(2).GetComponent<TMP_Text>();
UpdateTempo();
}
private void Update()
{
if (RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Camera.main))
{
float newTempo = Input.mouseScrollDelta.y;
if (Input.GetKey(KeyCode.LeftShift))
newTempo *= 5f;
if (Input.GetKey(KeyCode.LeftControl))
newTempo /= 100f;
tempoChange.tempo += newTempo;
}
UpdateTempo();
}
private void UpdateTempo()
{
tempoTXT.text = $"{tempoChange.tempo} BPM";
}
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: dfe88f36dac55f44dac7fe958fe3c228
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -6,13 +6,15 @@ using UnityEngine.UI;
using TMPro; using TMPro;
using Starpelly; using Starpelly;
namespace RhythmHeavenMania.Editor namespace RhythmHeavenMania.Editor.Track
{ {
public class Timeline : MonoBehaviour public class Timeline : MonoBehaviour
{ {
[Header("Song Positions")] [Header("Song Positions")]
[SerializeField] private TMP_Text SongBeat; [SerializeField] private TMP_Text SongBeat;
[SerializeField] private TMP_Text SongPos; [SerializeField] private TMP_Text SongPos;
[SerializeField] private TMP_Text CurrentTempo;
[SerializeField] private RectTransform StartingBPM;
[Header("Timeline Properties")] [Header("Timeline Properties")]
private float lastBeatPos = 0; private float lastBeatPos = 0;
@ -38,11 +40,19 @@ namespace RhythmHeavenMania.Editor
public Button StopBTN; public Button StopBTN;
public Button MetronomeBTN; public Button MetronomeBTN;
public Button AutoplayBTN; public Button AutoplayBTN;
public Button SelectionsBTN;
public Button TempoChangeBTN;
public Button MusicVolumeBTN;
public static Timeline instance { get; private set; } public static Timeline instance { get; private set; }
#region Initializers #region Initializers
public void UpdateLevelInfo()
{
StartingBPM.GetChild(0).GetComponent<TMP_Text>().text = GameManager.instance.Beatmap.bpm.ToString();
}
public void Init() public void Init()
{ {
instance = this; instance = this;
@ -106,6 +116,10 @@ namespace RhythmHeavenMania.Editor
} }
}); });
Tooltip.AddTooltip(SongBeat.gameObject, "Current Beat");
Tooltip.AddTooltip(SongPos.gameObject, "Current Time");
Tooltip.AddTooltip(CurrentTempo.gameObject, "Current Tempo (BPM)");
Tooltip.AddTooltip(PlayBTN.gameObject, "Play <color=#adadad>[Space]</color>"); Tooltip.AddTooltip(PlayBTN.gameObject, "Play <color=#adadad>[Space]</color>");
Tooltip.AddTooltip(PauseBTN.gameObject, "Pause <color=#adadad>[Shift + Space]</color>"); Tooltip.AddTooltip(PauseBTN.gameObject, "Pause <color=#adadad>[Shift + Space]</color>");
Tooltip.AddTooltip(StopBTN.gameObject, "Stop <color=#adadad>[Space]</color>"); Tooltip.AddTooltip(StopBTN.gameObject, "Stop <color=#adadad>[Space]</color>");
@ -113,8 +127,14 @@ namespace RhythmHeavenMania.Editor
Tooltip.AddTooltip(MetronomeBTN.gameObject, "Metronome"); Tooltip.AddTooltip(MetronomeBTN.gameObject, "Metronome");
Tooltip.AddTooltip(AutoplayBTN.gameObject, "Autoplay"); Tooltip.AddTooltip(AutoplayBTN.gameObject, "Autoplay");
Tooltip.AddTooltip(SelectionsBTN.gameObject, "Tool: Selection <color=#adadad>[1]</color>");
Tooltip.AddTooltip(TempoChangeBTN.gameObject, "Tool: Tempo Change <color=#adadad>[2]</color>");
Tooltip.AddTooltip(MusicVolumeBTN.gameObject, "Tool: Music Volume <color=#adadad>[3]</color>");
SetTimeButtonColors(true, false, false); SetTimeButtonColors(true, false, false);
MetronomeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray; MetronomeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
UpdateLevelInfo();
} }
public static string RandomID() public static string RandomID()
@ -179,6 +199,20 @@ namespace RhythmHeavenMania.Editor
TimelineContent.transform.localPosition = new Vector3((-Conductor.instance.songPositionInBeats * 100) + 200, TimelineContent.transform.localPosition.y); TimelineContent.transform.localPosition = new Vector3((-Conductor.instance.songPositionInBeats * 100) + 200, TimelineContent.transform.localPosition.y);
TimelineContent.transform.localPosition = new Vector3(Mathf.Clamp(TimelineContent.transform.localPosition.x, Mathf.NegativeInfinity, 0), TimelineContent.transform.localPosition.y); TimelineContent.transform.localPosition = new Vector3(Mathf.Clamp(TimelineContent.transform.localPosition.x, Mathf.NegativeInfinity, 0), TimelineContent.transform.localPosition.y);
CurrentTempo.text = $" = {Conductor.instance.songBpm}";
if (RectTransformUtility.RectangleContainsScreenPoint(StartingBPM, Input.mousePosition, Camera.main))
{
float increase = Input.mouseScrollDelta.y;
if (Input.GetKey(KeyCode.LeftControl))
increase /= 100f;
if (Input.GetKey(KeyCode.LeftShift))
increase *= 5f;
GameManager.instance.Beatmap.bpm += increase;
UpdateLevelInfo();
}
} }
private void SliderControl() private void SliderControl()

View file

@ -6,7 +6,7 @@ using UnityEngine.UI;
using Starpelly; using Starpelly;
using DG.Tweening; using DG.Tweening;
namespace RhythmHeavenMania.Editor namespace RhythmHeavenMania.Editor.Track
{ {
public class TimelineEventObj : MonoBehaviour public class TimelineEventObj : MonoBehaviour
{ {
@ -41,6 +41,7 @@ namespace RhythmHeavenMania.Editor
private bool resizingRight; private bool resizingRight;
private bool inResizeRegion; private bool inResizeRegion;
public Vector2 lastMovePos; public Vector2 lastMovePos;
public bool isCreating;
public string eventObjID; public string eventObjID;
[Header("Colors")] [Header("Colors")]
@ -238,13 +239,17 @@ namespace RhythmHeavenMania.Editor
{ {
if (eligibleToMove) if (eligibleToMove)
{ {
OnComplete(true); OnComplete(true);
} }
moving = false; moving = false;
Cancel(); Cancel();
if (isCreating == true)
{
isCreating = false;
CommandManager.instance.Execute(new Commands.Place(this));
}
} }
} }

View file

@ -16,8 +16,8 @@
"EventSelectedCol": "61e5ff", "EventSelectedCol": "61e5ff",
"EventNormalCol": "FFFFFF", "EventNormalCol": "FFFFFF",
"BeatMarkerCol": "61e5ff", "BeatMarkerCol": "32FF32",
"CurrentTimeMarkerCol": "61e5ff", "CurrentTimeMarkerCol": "32FF32",
"BoxSelectionCol": "61e5ff", "BoxSelectionCol": "61e5ff",
"BoxSelectionOutlineCol": "61e5ff" "BoxSelectionOutlineCol": "61e5ff"

View file

@ -104,7 +104,16 @@ namespace RhythmHeavenMania
new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentBeat); }, 2f), new GameAction("ball dispense", delegate { SpaceSoccer.instance.Dispense(eventCaller.currentBeat); }, 2f),
new GameAction("keep-up", delegate { }, 4f, true), new GameAction("keep-up", delegate { }, 4f, true),
new GameAction("high kick-toe!", delegate { }, 3f), new GameAction("high kick-toe!", delegate { }, 3f),
}) }),
/*new Minigame("djSchool", "DJ School", "B888F8", new List<GameAction>()
{
}),
new Minigame("spaceDance", "Space Dance", "B888F8", new List<GameAction>()
{
}),
new Minigame("tapTrial", "Tap Trial", "B888F8", new List<GameAction>()
{
})*/
}; };
} }
} }