Ejemplo n.º 1
0
    public static void UpdateGameProgression(Action <GameProgressionRepresentation> updateRep)
    {
        GameProgressionRepresentation rep = GetGameProgressionRepresentation();

        updateRep(rep);
        SetGameProgressionRepToPlayerPrefs(rep);
    }
Ejemplo n.º 2
0
    private static GameProgressionRepresentation GetGameProgressionRepresentation()
    {
        string stringRep = PlayerPrefs.GetString(GAME_PROGRESSION_KEY);
        GameProgressionRepresentation rep = JsonUtility.FromJson <GameProgressionRepresentation>(stringRep);

        return(rep != null ? rep : new GameProgressionRepresentation());
    }
Ejemplo n.º 3
0
    private static void SetGameProgressionRepToPlayerPrefs(GameProgressionRepresentation rep)
    {
        string json = JsonUtility.ToJson(rep);

        PlayerPrefs.SetString(GAME_PROGRESSION_KEY, json);
    }
Ejemplo n.º 4
0
    public static float GetGameProgressionField(Func <GameProgressionRepresentation, float> getRepField)
    {
        GameProgressionRepresentation rep = GetGameProgressionRepresentation();

        return(getRepField(rep));
    }