Ejemplo n.º 1
0
    public void LoadGame()
    {
        PlayerData data = GameDataController.LoadData();

        health    = data.health;
        maxHealth = data.maxHealth;
        currency  = data.currency;

        Vector3 playerPosition;

        playerPosition.x = data.playerPosition[0];
        playerPosition.y = data.playerPosition[1];
        playerPosition.z = data.playerPosition[2];

        Vector3 dronePosition;

        dronePosition.x = data.dronePosition[0];
        dronePosition.y = data.dronePosition[1];
        dronePosition.z = data.dronePosition[2];

        Vector2 checkpointPosition;

        checkpointPosition.x = data.lastCheckpointPos[0];
        checkpointPosition.y = data.lastCheckpointPos[1];
        lastCheckpointPos    = checkpointPosition;

        lastCheckpointLevelIndex = data.lastCheckpointLevelIndex;

        currentScene = data.currentScene;
    }