Skip to content

Commit

Permalink
Minor improvements, stable af
Browse files Browse the repository at this point in the history
  • Loading branch information
Crustacean1 committed Apr 21, 2020
1 parent 6b9d677 commit 7d37930
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Assets/Scripts/LevelManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,32 @@ void setActivity(bool on)
objects[i].SetActive(on);
}
}
void activatePlayer(bool on)
{
int count = Resources.FindObjectsOfTypeAll<Player>().Length;
if(count>0)
{
Debug.Log("Localized");
Resources.FindObjectsOfTypeAll<Player>()[0].gameObject.SetActive(on);
}
count = Resources.FindObjectsOfTypeAll<Kid>().Length;
if(count>0)
{
Resources.FindObjectsOfTypeAll<Kid>()[0].gameObject.SetActive(on);
}
}
IEnumerator screenLoading(int i)
{
//Nothing state changing may come before this
if(occupied)
{
yield break;
}
occupied = true;

activatePlayer(false);
setActivity(false);

if(gameOverScreen!=null&&i==0)
{
gameOverScreen.enabled = true;
Expand Down Expand Up @@ -157,10 +175,15 @@ IEnumerator screenLoading(int i)
{
loadingScreen.enabled = false;
}

aManager.Stop();
aManager.PlayTrack();

setActivity(true);
activatePlayer(true);

occupied = false;
//setActivity(true);

yield return null;
}

Expand Down

0 comments on commit 7d37930

Please sign in to comment.