Beispiel #1
0
 private void InitializeLevel()
 {
     print("Initializing level");
     CurrentLevel = DistanceFinder.FindMinimumDistance(Player, Levels);
     Cam.InitializeLevel(CurrentLevel);
     Player.BroadcastMessage("NotifyNewLevel");
     ScriptHome.BroadcastMessage("NotifyNewLevel", CurrentLevel);
 }
Beispiel #2
0
        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);
            }
        }