Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Default config in offline app

Discussion in 'Unity Remote Config' started by Pavel_Belokruenko, Sep 19, 2020.

  1. Pavel_Belokruenko

    Pavel_Belokruenko

    Joined:
    Sep 14, 2018
    Posts:
    15
    Hi! I want to make a game where is an Internet connection is not required

    So question is next: can I build my project with already prepared version of config?
    I need that for next case: user can start first game session without internet connection, so he will not have cached version of config. (i decided to store my balance in config and can't start game without it)

    I know about methods like below:

    Code (CSharp):
    1. public string GetString(string key, string defaultValue = "");
    but it is not the most comfortable way when you have more than hundred fields.
    And it quite uncomfortable to manage when you have hundreds of fields in dashboard AND hundreds of fields in c# script. Every change sounds like hell

    So I have a suggestion: it will be great if when pulling config from editor - last pulled version is saved as default.
    Or maybe use modified local version in editor.
     
    Last edited: Sep 19, 2020
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    You would want to use the defaultValue in the offline case. Are you saying it's difficult for you to update many default values? Do they change often enough to be an issue? The Config isn't "pulled from the Editor" at runtime, it's pulled from the server.
     
  3. Pavel_Belokruenko

    Pavel_Belokruenko

    Joined:
    Sep 14, 2018
    Posts:
    15
    No, I wouldn't.

    I think this quite obvious

    It seems to me that if it is decided to make a product for someone, it should be convenient in as many cases as possible.

    You are shifting the responsibility for default values to the user, despite the fact that you have the technical ability to do it yourself.

    It is not difficult, it is inconvenient.
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Sorry, I meant you would want to use the cached value in the offline scenario, not the default case. If it was the first time user, then yes, it would use the default. Without knowing what you desire, it's difficult to suggest or implement the solution! Please describe what you would expect? My suspicion for what you are looking for is a locally saved object, perhaps exported during application build, that contains a look up for the default values. Then the RC Editor would allow you to set and edit the defaults in tabular format. Would that work? I don't think we would want to auto-generate the C# code for you, that would be difficult to maintain and edit. A look up table as suggested might work, however.