Skip to content

Commit

Permalink
Merge branch 'hotfix/Fix_editor_works_but_builds_fail'
Browse files Browse the repository at this point in the history
  • Loading branch information
guneyozsan committed Nov 25, 2017
2 parents fb6a5d6 + 47a4537 commit 3118ff0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 98 deletions.
10 changes: 1 addition & 9 deletions Assets/Scripts/AnimationManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ void Start()
}
}

bool exploded;

void Update()
{
#if UNITY_EDITOR
Expand All @@ -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);
}

Expand Down
1 change: 0 additions & 1 deletion Assets/Scripts/Debugging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
Expand Down
96 changes: 8 additions & 88 deletions Assets/Scripts/Sequencer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -83,9 +80,7 @@ void Start()
#endif

CurrentBar = 1;
#if UNITY_EDITOR
CurrentBeat = 1;
#endif
}


Expand All @@ -98,9 +93,9 @@ void Update()
FastForward();
}

SetBeats();
#endif
SetCurrentRegion();
#endif
SetBeats();
LoopMusicTo(loopToBar);
}

Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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
}
}
}
1 change: 1 addition & 0 deletions ProjectSettings/GraphicsSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 3118ff0

Please sign in to comment.