Skip to content

Commit

Permalink
Update GameManager.cs
Browse files Browse the repository at this point in the history
Added the new SceneManager
  • Loading branch information
ArmandCloud committed May 19, 2016
1 parent ff9782f commit d5edbee
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace NearbyDroids
using GooglePlayGames.BasicApi.Nearby;
using UnityEngine;
using UnityEngine.UI;

using UnityEngine.SceneManagement;
/// <summary>
/// Game manager manages the game play and players.
/// Heavily inspired by http://unity3d.com/learn/tutorials/projects/2d-roguelike
Expand Down Expand Up @@ -405,7 +405,7 @@ public void StartPlaying(GameType type)
}

// 1 is the game, 0 is the main menu
Application.LoadLevel(1);
SceneManager.LoadScene(1);
}

/// <summary>
Expand All @@ -424,7 +424,7 @@ public void StopPlaying()
}

// 0 is the main menu scene.
Application.LoadLevel(0);
SceneManager.LoadScene(0);
}

/// <summary>
Expand All @@ -437,7 +437,7 @@ public void StartNextLevel()
if (gameType == GameType.MultiplayerLocal ||
gameType == GameType.SinglePlayer)
{
Application.LoadLevel(Application.loadedLevel);
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}

Expand Down Expand Up @@ -642,7 +642,7 @@ public void NotifyChanges()
internal void Update()
{
// if we are on the main menu, don't update.
if (Application.loadedLevel == 0)
if (SceneManager.GetActiveScene().buildIndex == 0)
{
return;
}
Expand Down Expand Up @@ -1006,4 +1006,4 @@ internal List<PlayerInfo.PlayerData> Players
}
}
}
}
}

0 comments on commit d5edbee

Please sign in to comment.