2D Toolkit Forum
2D Toolkit => Support => Topic started by: robertwahler on March 28, 2014, 01:07:05 pm
-
Hi,
Could someone help me trouble shoot this error message? I get dozens on these errors when switching platforms in "build settings". Stack trace is below. The errors started when I updated 2d Toolkit to 2.4.0. The error doesn't seem to prevent the game from running. Everything works fine but I'd like to understand the issue. Thanks!
Here is the full stack trace:
Fatal error - font from sprite collection is has an invalid material
UnityEngine.Debug:LogError(Object)
tk2dFontData:Init() (at Assets/Vendor/TK2DROOT/tk2d/Code/Fonts/tk2dFontData.cs:152)
tk2dFontData:get_inst() (at Assets/Vendor/TK2DROOT/tk2d/Code/Fonts/tk2dFontData.cs:130)
tk2dTextMesh:InitInstance() (at Assets/Vendor/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:376)
tk2dTextMesh:DoNotUse__CommitInternal() (at Assets/Vendor/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:624)
tk2dUpdateManager:QueueCommit(tk2dTextMesh) (at Assets/Vendor/TK2DROOT/tk2d/Code/Runtime/tk2dUpdateManager.cs:30)
tk2dTextMesh:SetNeedUpdate(UpdateFlags) (at Assets/Vendor/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:252)
tk2dTextMesh:Init(Boolean) (at Assets/Vendor/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:528)
tk2dTextMesh:ForceBuild() (at Assets/Vendor/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:755)
tk2dTextMesh:OnEnable() (at Assets/Vendor/TK2DROOT/tk2d/Code/Fonts/tk2dTextMesh.cs:415)
UnityEditor.HostView:OnGUI()
-
So do you just get this when you switch build platforms and nowhere else? Is it specific build platforms that trigger this or everything?
-
It happens switching between any of l the platforms I use, PC/Mac, Android, and iOS. I get more or less errors depending on what is in the current scene in the editor. If I switch platforms with a blank scene open, I get no errors.
If I examine the Mesh Renderer component on any of my tk2dTextMeshes, I can see the the Material looks wrong. Instead of saying atlas0 material, I see something like tk2dInternal$.Material_Stones@1x_atlast0 material. The name of my sprite collection is 'Stones'. I guess that the file association has been broken in all my text prefabs? Rebuilding the sprite collection doesn't fix the issue. Any ideas? Thanks for your help.
-
The material is fine - its expected for platform collections / when you use png textures.
Whats really bizarre is that I can't reproduce this. Can you create a simple repro case and send to support?
-
I just emailed support a sample project with the error. Thanks for your help.
-
Hi,
was there any resolution for this? I am just experiencing the same...
Thanks, habitoti
-
Hi,
I've found one font atlas that caused the whole trouble and prevented the processing of everything else after the platform switch. After opening that atlas in the collection editor and re-committing it, everything went well. So seemingly just some glitch in the course of platform switching...
Thanks, habitoti