Search Unity

LocalizedString.GetLocalizedString().WaitForCompletion() race condition

Discussion in 'Localization Tools' started by deek0146, May 7, 2021.

  1. deek0146

    deek0146

    Joined:
    Mar 21, 2013
    Posts:
    4
    Hi.

    I have a LocalizedString field, and in the Start() function of another Monobehaviour I'm calling GetLocalizedString(params object[] arguments).WaitForCompletion()

    This causes the unity editor to freeze when I hit play, which I assume is due to WaitForCompletion holding up the main thread in Monobehaviour.Start() before the LocalizationTables have initialised. How can I best get around this, without turning my Start() routine into a Coroutine?

    Is there an object that I can place first in the Script Execution Order menu that will prevent this from happening?
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
  3. deek0146

    deek0146

    Joined:
    Mar 21, 2013
    Posts:
    4
    Hi Karl, thanks that's great to hear!
     
    karl_jones likes this.