add tunnel sound

This commit is contained in:
minenice55 2023-11-21 20:59:05 -05:00
parent 156014f5ed
commit 915a5d32d0
9 changed files with 87 additions and 8 deletions

View file

@ -25,7 +25,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 51355916537813500}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 13.7, y: 0.66, z: 3}
m_LocalPosition: {x: 13.7, y: 0.66, z: 2}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
@ -422,7 +422,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &1776695555037247447
Transform:
m_ObjectHideFlags: 0
@ -1500,7 +1500,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6725178218746906490}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.31, y: 3.98, z: 4}
m_LocalPosition: {x: -0.31, y: 3.98, z: 2}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:

View file

@ -4,5 +4,5 @@ folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
assetBundleName: ntrtunnel/locale
assetBundleVariant: en

Binary file not shown.

View file

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 129351fbf9a0224498b2b7d6ad2affad
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName: ntrtunnel/common
assetBundleVariant:

Binary file not shown.

View file

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: 4707960e8ca4d3541a5c6721bbbde5cf
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName: ntrtunnel/common
assetBundleVariant:

Binary file not shown.

View file

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: a1c2b2ce831ddba439aa571419b1bbc0
AudioImporter:
externalObjects: {}
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName: ntrtunnel/common
assetBundleVariant:

View file

@ -69,6 +69,7 @@ namespace HeavenStudio.Games
Tween bgColorTween;
Tween fgColorTween;
Vector3 tunnelStartPos;
Sound tunnelSoundRight, tunnelSoundMiddle, tunnelSoundLeft;
[Header("References")]
@ -121,6 +122,9 @@ namespace HeavenStudio.Games
if (Conductor.instance != null && Conductor.instance.NotStopped())
{
Conductor.instance.FadeMinigameVolume(Conductor.instance.songPositionInBeatsAsDouble, 0, 1);
tunnelSoundRight?.Stop();
tunnelSoundMiddle?.Stop();
tunnelSoundLeft?.Stop();
}
}
@ -163,10 +167,10 @@ namespace HeavenStudio.Games
ScheduleInput(lastCowbell, 1, InputAction_BasicPress, CowbellSuccess, CowbellMiss, CowbellEmpty);
}
bg.position = new Vector3(bgStartX - (2 * bgStartX * (((float)Time.realtimeSinceStartupAsDouble % bgScrollTime) / bgScrollTime)), 0, 0);
// bg.localPosition = new Vector3(bgStartX - (2 * bgStartX * (((float)Time.realtimeSinceStartupAsDouble % bgScrollTime) / bgScrollTime)), 0, 0);
if (tunnelWall.activeSelf)
{
tunnelWall.transform.position = tunnelStartPos - new Vector3(tunnelChunksPerSec * tunnelWallChunkSize * (float)(cond.songPositionAsDouble - tunnelStartTime), 0, 0);
tunnelWall.transform.localPosition = tunnelStartPos - new Vector3(tunnelChunksPerSec * tunnelWallChunkSize * (float)(cond.songPositionAsDouble - tunnelStartTime), 0, 0);
}
if (cond.songPositionAsDouble >= tunnelEndTime + PostTunnelScrnTime)
{
@ -275,10 +279,19 @@ namespace HeavenStudio.Games
double durationSec = Math.Ceiling((tunnelEndTime - tunnelStartTime) * 4 * tunnelChunksPerSec) * 0.25 / tunnelChunksPerSec;
tunnelWallRenderer.size = new Vector2((float)durationSec * tunnelWallChunkSize * tunnelChunksPerSec, 13.7f);
tunnelWall.transform.position = tunnelStartPos;
tunnelWall.transform.localPosition = tunnelStartPos;
tunnelWall.SetActive(true);
this.fadeDuration = fadeDuration;
cond.FadeMinigameVolume(beat, fadeDuration, volume);
tunnelSoundRight = SoundByte.PlayOneShotGame("tunnel/tunnelRight", beat, looping: true);
tunnelSoundMiddle = SoundByte.PlayOneShotGame("tunnel/tunnelMiddle", beat + (6/48f), looping: true);
tunnelSoundLeft = SoundByte.PlayOneShotGame("tunnel/tunnelLeft" + (12/48f), beat, looping: true);
double tunnelEnd = cond.GetBeatFromSongPos(tunnelEndTime + PostTunnelScrnTime);
tunnelSoundRight.SetLoopParams(tunnelEnd, 0.1);
tunnelSoundMiddle.SetLoopParams(tunnelEnd + (6/48f), 0.1);
tunnelSoundLeft.SetLoopParams(tunnelEnd + (12/48f), 0.1);
}
}
}