diff --git a/Assets/Scripts/AnimationManager.cs b/Assets/Scripts/AnimationManager.cs index c78a7da..49a4891 100644 --- a/Assets/Scripts/AnimationManager.cs +++ b/Assets/Scripts/AnimationManager.cs @@ -105,8 +105,6 @@ void Start() } } - bool exploded; - void Update() { #if UNITY_EDITOR @@ -116,21 +114,15 @@ void Update() switch (Sequencer.CurrentBar) { case 4: - if (Sequencer.CurrentBeat == 1 && !exploded) - { - openingTitlesMusic.FormTitle(12f * Sequencer.BarDurationF, 0.005f, true, false); - exploded = true; - } - if (animationCurrentBar != Sequencer.CurrentBar) { - // sun = Instantiate(newSun, new Vector3(0, alignY, 0), Quaternion.identity); // sun.localScale = new Vector3(5, 5, 5); // sun.tag = "Sun"; //#if UNITY_EDITOR // sun.name = "PyramidSun"; //#endif + openingTitlesMusic.FormTitle(12f * Sequencer.BarDurationF, 0.005f, true, false); SetGravity(0); } diff --git a/Assets/Scripts/Debugging.cs b/Assets/Scripts/Debugging.cs index ebdfe94..3ba81b4 100644 --- a/Assets/Scripts/Debugging.cs +++ b/Assets/Scripts/Debugging.cs @@ -47,7 +47,6 @@ void OnGUI() + " Time: " + (int)(Sequencer.MusicDebug.time * 1000) + " ms" + Environment.NewLine + "-------------------------------------------" + Environment.NewLine + "Part: " + Sequencer.CurrentPart + Environment.NewLine - + "Region: " + Sequencer.CurrentRegionId + Environment.NewLine + Sequencer.CurrentRegionDescription ); } diff --git a/Assets/Scripts/Sequencer.cs b/Assets/Scripts/Sequencer.cs index 5b07db8..d938805 100644 --- a/Assets/Scripts/Sequencer.cs +++ b/Assets/Scripts/Sequencer.cs @@ -25,17 +25,14 @@ public class Sequencer : MonoBehaviour AudioSource music; #if UNITY_EDITOR public static AudioSource MusicDebug { get; private set; } -#endif - public static int CurrentRegionId { get; private set; } -#if UNITY_EDITOR public static Part CurrentPart { get; private set; } public static string CurrentRegionDescription { get; private set; } public enum Part { Intro, Part1Approach, Part2Probe }; - public static int CurrentBeat { get; private set; } #endif + public static int CurrentBeat { get; private set; } public static int CurrentBar { get; private set; } int BPM; @@ -83,9 +80,7 @@ void Start() #endif CurrentBar = 1; -#if UNITY_EDITOR CurrentBeat = 1; -#endif } @@ -98,9 +93,9 @@ void Update() FastForward(); } - SetBeats(); -#endif SetCurrentRegion(); +#endif + SetBeats(); LoopMusicTo(loopToBar); } @@ -143,212 +138,138 @@ void FastForward() #endif +#if UNITY_EDITOR void SetCurrentRegion() { if (music.time < 9.350) { - CurrentRegionId = 1; -#if UNITY_EDITOR CurrentPart = Part.Intro; CurrentRegionDescription = "wind intro"; -#endif } else if (music.time < 15.584) { - CurrentRegionId = 2; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "explosion"; -#endif } else if (music.time < 21.818) { - CurrentRegionId = 3; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "ping sound!"; -#endif } else if (music.time < 46.753) { - CurrentRegionId = 4; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "musical base"; -#endif } else if (music.time < 96.623) { - CurrentRegionId = 5; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "melody"; -#endif } else if (music.time < 121.558) { - CurrentRegionId = 6; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "bass"; -#endif } else if (music.time < 146.493) { - CurrentRegionId = 7; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "hihat and full bass"; -#endif } else if (music.time < 171.428) { - CurrentRegionId = 8; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "bass syncopation"; -#endif } else if (music.time < 183.896) { - CurrentRegionId = 9; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "Part 1 to 2 bridge"; -#endif } else if (music.time < 233.766) { - CurrentRegionId = 10; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "A: musical base"; -#endif } else if (music.time < 258.701) { - CurrentRegionId = 11; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "A: melody"; -#endif } else if (music.time < 283.636) { - CurrentRegionId = 12; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "AB bridge"; -#endif } else if (music.time < 308.571) { - CurrentRegionId = 13; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "B: musical base"; -#endif } else if (music.time < 333.506) { - CurrentRegionId = 14; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "B: melody"; -#endif } else if (music.time < 358.441) { - CurrentRegionId = 15; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "AB bridge"; -#endif } else if (music.time < 383.376) { - CurrentRegionId = 16; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "B: melody"; -#endif } else if (music.time < 408.311) { - CurrentRegionId = 17; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "AB bridge"; -#endif } else if (music.time < 433.246) { - CurrentRegionId = 18; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "A: melody"; -#endif } else if (music.time < 458.181) { - CurrentRegionId = 19; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "AB bridge"; -#endif } else if (music.time < 483.116) { - CurrentRegionId = 20; -#if UNITY_EDITOR CurrentPart = Part.Part2Probe; CurrentRegionDescription = "Part 2 to 1 bridge"; -#endif } else if (music.time < 508.051) { - CurrentRegionId = 21; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "Part 1 rhythm + melody + hihat"; -#endif } else if (music.time < 532.986) { - CurrentRegionId = 22; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "Part 1 rhythm + melody"; -#endif } else if (music.time < 557.922) { - CurrentRegionId = 23; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "Part 1 melody + bass"; -#endif } else if (music.time < 582.857) { - CurrentRegionId = 24; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "Part 1 melody + bass + hihat"; -#endif } else { // if (music.time < 595.324) { - CurrentRegionId = 25; -#if UNITY_EDITOR CurrentPart = Part.Part1Approach; CurrentRegionDescription = "Part 1 to 2 bridge"; -#endif } } +#endif -#if UNITY_EDITOR void SetBeats() { if (music.time > ((CurrentBar - 1) * 4 + CurrentBeat) * BeatDuration) @@ -364,12 +285,13 @@ void SetBeats() } } +#if UNITY_EDITOR if (Time.timeScale != 1 && (music.time + Time.deltaTime * (Time.timeScale - 1)) >= 0) { music.time += Time.deltaTime * (Time.timeScale - 1); } - } #endif + } void LoopMusicTo(int loopToBar) @@ -378,11 +300,9 @@ void LoopMusicTo(int loopToBar) { music.time = (float)((loopToBar - 1d) * 4d * BeatDuration); music.Play(); - CurrentBar = this.loopToBar; + CurrentBar = loopToBar; -#if UNITY_EDITOR CurrentBeat = 1; -#endif } } } diff --git a/ProjectSettings/GraphicsSettings.asset b/ProjectSettings/GraphicsSettings.asset index 9abe97a..93ca430 100644 --- a/ProjectSettings/GraphicsSettings.asset +++ b/ProjectSettings/GraphicsSettings.asset @@ -35,6 +35,7 @@ GraphicsSettings: - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10782, guid: 0000000000000000f000000000000000, type: 0} + - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} m_PreloadedShaders: [] m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}