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.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice
  4. Join us on Thursday, September 29, for a day with Unity's SRP teams here on the forum or on Reddit, and discuss topics around URP, HDRP, and the Scriptable Render Pipeline in general.
    Dismiss Notice

Local variable of type ObjectReference is set to "Empty" when reloading scene

Discussion in 'Localization Tools' started by plmx, Dec 15, 2021.

  1. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    306
    So, we have a local variable with an object reference like so:

    Issue1.png

    I save the scene, and reopen it; the view changes to this:

    Issue2.png

    I get a few of these will changing the variable name and the object reference, not sure if this is related:

    Code (csharp):
    1. Could not reach source property name 'm_StringReference.m_LocalVariables.Array.data[0]' while extracting diffs, the reference does not exist in the source serialized data
    At runtime, I get error message upon displaying that string, although the string is in fact correctly resolved and displayed...

    Code (csharp):
    1.  
    2. FormattingException: Error parsing format string: Object reference not set to an instance of an object at 23
    3. Drücke den {button.Name} für Massenvernichtung nach Aufladung
    4. -----------------------^
    5. UnityEngine.Localization.SmartFormat.SmartFormatter.FormatError (UnityEngine.Localization.SmartFormat.Core.Parsing.FormatItem errorItem, System.Exception innerException, System.Int32 startIndex, UnityEngine.Localization.SmartFormat.Core.Formatting.FormattingInfo formattingInfo) (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Smart Format/SmartFormatter.cs:347)
    6. UnityEngine.Localization.SmartFormat.SmartFormatter.Format (UnityEngine.Localization.SmartFormat.Core.Formatting.FormattingInfo formattingInfo) (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Smart Format/SmartFormatter.cs:319)
    7. UnityEngine.Localization.SmartFormat.SmartFormatter.Format (UnityEngine.Localization.SmartFormat.Core.Formatting.FormatDetails formatDetails, UnityEngine.Localization.SmartFormat.Core.Parsing.Format format, System.Object current) (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Smart Format/SmartFormatter.cs:286)
    8. UnityEngine.Localization.SmartFormat.SmartFormatter.FormatWithCache (UnityEngine.Localization.SmartFormat.Core.Formatting.FormatCache& cache, System.String format, System.IFormatProvider formatProvider, System.Collections.Generic.IList`1[T] args) (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Smart Format/SmartFormatter.cs:257)
    9. UnityEngine.Localization.Tables.StringTableEntry.GetLocalizedString (System.IFormatProvider formatProvider, System.Collections.Generic.IList`1[T] args, UnityEngine.Localization.Pseudo.PseudoLocale pseudoLocale) (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Tables/StringTable.cs:176)
    10. UnityEngine.Localization.Settings.LocalizedStringDatabase.GenerateLocalizedString (UnityEngine.Localization.Tables.StringTable table, UnityEngine.Localization.Tables.StringTableEntry entry, UnityEngine.Localization.Tables.TableReference tableReference, UnityEngine.Localization.Tables.TableEntryReference tableEntryReference, UnityEngine.Localization.Locale locale, System.Collections.Generic.IList`1[T] arguments) (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Settings/Database/LocalizedStringDatabase.cs:244)
    11. UnityEngine.Localization.LocalizedString.RefreshString () (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Localized Reference/LocalizedString.cs:206)
    12. UnityEngine.Localization.LocalizedString.AutomaticLoadingCompleted (UnityEngine.ResourceManagement.AsyncOperations.AsyncOperationHandle`1[TObject] loadOperation) (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Localized Reference/LocalizedString.cs:700)
    13. UnityEngine.Localization.LocalizedString.HandleLocaleChange (UnityEngine.Localization.Locale _) (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Localized Reference/LocalizedString.cs:690)
    14. UnityEngine.Localization.LocalizedString.ForceUpdate () (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Localized Reference/LocalizedString.cs:593)
    15. UnityEngine.Localization.LocalizedString.add_StringChanged (UnityEngine.Localization.LocalizedString+ChangeHandler value) (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Localized Reference/LocalizedString.cs:109)
    16. UnityEngine.Localization.Components.LocalizeStringEvent.RegisterChangeHandler () (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Component Localizers/LocalizeStringEvent.cs:130)
    17. UnityEngine.Localization.Components.LocalizeStringEvent.OnEnable () (at Library/PackageCache/com.unity.localization@1.0.2/Runtime/Component Localizers/LocalizeStringEvent.cs:81)
    18. UnityEngine.GameObject:SetActive(Boolean)
    This is on Unity 2019.4.21f1 and Localization 1.0.2.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    6,675
    Hey.
    This sounds like something someone mentioned the other day. Are you able to file a bug report?
     
  3. plmx

    plmx

    Joined:
    Sep 10, 2015
    Posts:
    306
    karl_jones likes this.
unityunity