Search Unity

Wait for remote config to load..

Discussion in 'Unity Remote Config' started by tsandecki, Feb 24, 2020.

  1. tsandecki

    tsandecki

    Joined:
    Jul 1, 2013
    Posts:
    1
    Simple question:
    It there a way to wait for remote config to load?

    I need some prop. to init my for example available resource in game but here comes some problem. Remote conf is loaded in Awake but using
    ConfigManager.FetchConfigs to it will fill config map when finished but in the mean time I've already created my resource status bar (in another object in Start method) :-(
     
  2. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    Could you not place your FetchConfig prior to your other code in Start? However, it's my understanding that Awake is indeed called prior to Start https://docs.unity3d.com/Manual/ExecutionOrder.html But I suspect your issue with with
    ApplyRemoteSettings as the callback, perhaps completing after your Start method?
     
  3. rambod

    rambod

    Unity Technologies

    Joined:
    Mar 2, 2018
    Posts:
    58
    @tsandecki ah this could be due to async nature of the Remote Config request, like @JeffDUnity3D pointed, the request can return after Start has ran. The best way would be to load your game on Start, but not start the game. Once the Remote Config request has returned, then you can proceed starting the game, kinda like a loading screen. I can give you an example of this would work if you'd like.
     
    vd_unity likes this.