private void InitializeLevel() { print("Initializing level"); CurrentLevel = DistanceFinder.FindMinimumDistance(Player, Levels); Cam.InitializeLevel(CurrentLevel); Player.BroadcastMessage("NotifyNewLevel"); ScriptHome.BroadcastMessage("NotifyNewLevel", CurrentLevel); }
void UpdateLevel() { GameObject newLevel = DistanceFinder.FindMinimumDistance(Player, Levels); if (CurrentLevel != newLevel) { print("Player changed levels"); CurrentLevel = newLevel; Cam.NotifyNewLevel(CurrentLevel); Player.BroadcastMessage("NotifyNewLevel"); ScriptHome.BroadcastMessage("NotifyNewLevel", CurrentLevel); } }