-
-
Notifications
You must be signed in to change notification settings - Fork 221
Open
Description
After importing VContainer into a fresh HDRP project in Unity 6000.2.6f2 and creating a custom lifetime scope I am getting many errors when such scope script is attached to any game object in the scene.
These errors seem to be related to multithreading, just have a look:
UnityException: GetName can only be called from the main thread.
Constructors and field initializers will be executed from the loading thread when loading a scene.
Don't use this function in the constructor or field initializers, instead move initialization code to the Awake or Start function.
UnityEngine.Object.GetName () (at <7b8172fcdd864e17924794813da71712>:0)
UnityEngine.Object.get_name () (at <7b8172fcdd864e17924794813da71712>:0)
UnityEngine.TextCore.Text.FontAsset.ReadFontAssetDefinition () (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.FontAsset.GetCharacterInLookupCache (System.UInt32 unicode, UnityEngine.TextCore.Text.FontStyles fontStyle, UnityEngine.TextCore.Text.TextFontWeight fontWeight, UnityEngine.TextCore.Text.Character& character) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.FontAssetUtilities.GetCharacterFromFontAsset_Internal (System.UInt32 unicode, UnityEngine.TextCore.Text.FontAsset sourceFontAsset, System.Boolean includeFallbacks, UnityEngine.TextCore.Text.FontStyles fontStyle, UnityEngine.TextCore.Text.TextFontWeight fontWeight, System.Boolean& isAlternativeTypeface, System.Boolean populateLigatures) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.FontAssetUtilities.GetCharacterFromFontAssetsInternal (System.UInt32 unicode, System.Collections.Generic.List`1[T] fontAssets, System.Boolean includeFallbacks, UnityEngine.TextCore.Text.FontStyles fontStyle, UnityEngine.TextCore.Text.TextFontWeight fontWeight, System.Boolean& isAlternativeTypeface, System.Boolean populateLigatures) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.FontAssetUtilities.GetCharacterFromFontAssetsInternal (System.UInt32 unicode, UnityEngine.TextCore.Text.FontAsset sourceFontAsset, System.Collections.Generic.List`1[T] fontAssets, System.Collections.Generic.List`1[T] OSFallbackList, System.Boolean includeFallbacks, UnityEngine.TextCore.Text.FontStyles fontStyle, UnityEngine.TextCore.Text.TextFontWeight fontWeight, System.Boolean& isAlternativeTypeface, System.Boolean populateLigatures) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.TextGenerator.GetEllipsisSpecialCharacter (UnityEngine.TextCore.Text.TextGenerationSettings generationSettings) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.TextGenerator.GetSpecialCharacters (UnityEngine.TextCore.Text.TextGenerationSettings generationSettings) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.TextGenerator.PrepareFontAsset (UnityEngine.TextCore.Text.TextGenerationSettings generationSettings) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.TextHandle.PrepareFontAsset () (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.UIElements.UITKTextJobSystem+PrepareTextJobData.Execute (System.Int32 index) (at <58affde3b6cc47f39fa7e8b94d5890c0>:0)
Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[T].Execute (T& jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <7b8172fcdd864e17924794813da71712>:0)
and
ArgumentException: An item with the same key has already been added. Key: 2097155
System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) (at <59bd7c40c082431db25e1e728ab62789>:0)
System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) (at <59bd7c40c082431db25e1e728ab62789>:0)
UnityEngine.TextCore.Text.FontAsset.AddSynthesizedCharacter (System.UInt32 unicode, System.Boolean isFontFaceLoaded, System.Boolean addImmediately) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.FontAsset.AddSynthesizedCharactersAndFaceMetrics () (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.FontAsset.ReadFontAssetDefinition () (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.FontAsset.GetCharacterInLookupCache (System.UInt32 unicode, UnityEngine.TextCore.Text.FontStyles fontStyle, UnityEngine.TextCore.Text.TextFontWeight fontWeight, UnityEngine.TextCore.Text.Character& character) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.FontAssetUtilities.GetCharacterFromFontAsset_Internal (System.UInt32 unicode, UnityEngine.TextCore.Text.FontAsset sourceFontAsset, System.Boolean includeFallbacks, UnityEngine.TextCore.Text.FontStyles fontStyle, UnityEngine.TextCore.Text.TextFontWeight fontWeight, System.Boolean& isAlternativeTypeface, System.Boolean populateLigatures) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.FontAssetUtilities.GetCharacterFromFontAssetsInternal (System.UInt32 unicode, System.Collections.Generic.List`1[T] fontAssets, System.Boolean includeFallbacks, UnityEngine.TextCore.Text.FontStyles fontStyle, UnityEngine.TextCore.Text.TextFontWeight fontWeight, System.Boolean& isAlternativeTypeface, System.Boolean populateLigatures) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.FontAssetUtilities.GetCharacterFromFontAssetsInternal (System.UInt32 unicode, UnityEngine.TextCore.Text.FontAsset sourceFontAsset, System.Collections.Generic.List`1[T] fontAssets, System.Collections.Generic.List`1[T] OSFallbackList, System.Boolean includeFallbacks, UnityEngine.TextCore.Text.FontStyles fontStyle, UnityEngine.TextCore.Text.TextFontWeight fontWeight, System.Boolean& isAlternativeTypeface, System.Boolean populateLigatures) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.TextGenerator.GetEllipsisSpecialCharacter (UnityEngine.TextCore.Text.TextGenerationSettings generationSettings) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.TextGenerator.GetSpecialCharacters (UnityEngine.TextCore.Text.TextGenerationSettings generationSettings) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.TextGenerator.Prepare (UnityEngine.TextCore.Text.TextGenerationSettings generationSettings, UnityEngine.TextCore.Text.TextInfo textInfo) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.TextGenerator.GenerateText (UnityEngine.TextCore.Text.TextGenerationSettings settings, UnityEngine.TextCore.Text.TextInfo textInfo) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.TextCore.Text.TextHandle.UpdateWithHash (System.Int32 hashCode) (at <611557e554d645f496d2cb012b849869>:0)
UnityEngine.UIElements.UITKTextHandle.UpdateMesh () (at <58affde3b6cc47f39fa7e8b94d5890c0>:0)
UnityEngine.UIElements.UITKTextJobSystem+GenerateTextJobData.Execute (System.Int32 index) (at <58affde3b6cc47f39fa7e8b94d5890c0>:0)
Unity.Jobs.IJobParallelForExtensions+ParallelForJobStruct`1[T].Execute (T& jobData, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <7b8172fcdd864e17924794813da71712>:0)
These 2 are the main ones that pop each time in play mode or when inspector tries to render custom component that derives from LifetimeScope.
Reproducible in Unity 6.2 only, 6.1 and below don't have this issue.
simon-nordon
Metadata
Metadata
Assignees
Labels
No labels