示例#1
0
    // Get game data
    protected override void LoadData()
    {
//TODO: sure it's called before any other method?
        gameSessionManager = GameSessionManager.Instance;
        currentLevel       = gameSessionManager.GetLevel();
        Debug.Log("GameDataManager:Load - level: " + currentLevel);

        lives     = gameSessionManager.GetLives();
        continues = gameSessionManager.GetContinues();

        LoadSpecifics();

        Debug.Log("GameDataManager:Load - lives: " + lives);
        Debug.Log("GameDataManager:Load - continues: " + continues);

        levels = GameGraphLoader.LoadLevelGraph(GRAPH_LEVELS);

        foreach (KeyValuePair <int, LevelNode> level in levels)
        {
            if (gameSessionManager.IsLevelCompleted(level.Key))
            {
                level.Value.completed = true;
            }
        }

/*
 * Debug.Log("levels:");
 *      foreach(KeyValuePair<int, LevelNode> levelNode in gameDataManager.levels) {
 *          LevelNode level = levelNode.Value;
 *          Debug.Log("level");
 *          Debug.Log("    id: " + level.id);
 *          Debug.Log("    scene: " + level.scene);
 *
 *          if (level.next != null) {
 *              for (int j=0; j<level.next.Count; ++j) {
 *                  Debug.Log("    next: " + level.next[j]);
 *              }
 *          }
 *      }
 */

        SetLevels();
    }