我将我在(4.5)中的GUI替换为4.6中的新UI系统。我正在使用4.6p1统一。游戏在Unity编辑器中运行良好,但一旦构建它就会在加载时崩溃。我删除了所有UI元素并构建并运行,但之后我的游戏没有UI。
在Unity中,控制台在构建时显示两个错误:
An asset is marked with HideFlags.DontSave but is included in the build:
Asset: 'Library/unity default resources'
(You are probably referencing internal Unity data in your build.)
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
和
Building - Failed to write file: Temp/StagingArea/Data/Resources/unity_builtin_extra
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun()
当我在运行游戏时收到崩溃日志时,这里是堆栈跟踪:
(0x000000013F8DEC91) c:\buildagent\work\d63dfc6385190b60\runtime\shaders\material.cpp (280 + 0x0): Unity::Material::CreateMaterial + 0x41
(0x000000000478627C) (Mono JIT code): (filename not available): UnityEngine.UI.Text:get_defaultMaterial () + 0x3c (0000000004786240 0000000004786295) [0000000003CD4D48 - Unity Root Domain] + 0x0
(0x0000000004786201) (Mono JIT code): (filename not available): UnityEngine.UI.Graphic:get_material () + 0x41 (00000000047861C0 0000000004786213) [0000000003CD4D48 - Unity Root Domain] + 0x0
(0x0000000004785D8C) (Mono JIT code): (filename not available): UnityEngine.UI.MaskableGraphic:get_material () + 0xec (0000000004785CA0 0000000004785D98) [0000000003CD4D48 - Unity Root Domain] + 0x0
(0x0000000004785B51) (Mono JIT code): (filename not available): UnityEngine.UI.Graphic:get_materialForRendering () + 0x61 (0000000004785AF0 0000000004785C72) [0000000003CD4D48 - Unity Root Domain] + 0x0
(0x0000000004785A77) (Mono JIT code): (filename not available): UnityEngine.UI.Graphic:UpdateMaterial () + 0x57 (0000000004785A20 0000000004785AC2) [0000000003CD4D48 - Unity Root Domain] + 0x0
(0x0000000004781DA8) (Mono JIT code): (filename not available): UnityEngine.UI.Graphic:Rebuild (UnityEngine.UI.CanvasUpdate) + 0x58 (0000000004781D50 0000000004781DB6) [0000000003CD4D48 - Unity Root Domain] + 0x0
(0x000000000478171D) (Mono JIT code): (filename not available): UnityEngine.UI.CanvasUpdateRegistry:PerformUpdate () + 0x46d (00000000047812B0 00000000047818B2) [0000000003CD4D48 - Unity Root Domain] + 0x0
(0x0000000004781276) (Mono JIT code): (filename not available): UnityEngine.Canvas:SendWillRenderCanvases () + 0x26 (0000000004781250 000000000478127C) [0000000003CD4D48 - Unity Root Domain] + 0x0
(0x0000000004730543) (Mono JIT code): (filename not available): (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr) + 0x63 (00000000047304E0 00000000047305B2) [0000000003CD4D48 - Unity Root Domain] + 0x0
(0x000007FEE01D3AF2) (mono): (filename not available): mono_set_defaults + 0x2b9e
(0x0000000003DDB0B8) ((module-name not available)): (filename not available): (function-name not available) + 0x0
(0x00000000FFFFFFFF) ((module-name not available)): (filename not available): (function-name not available) + 0x0
(0x0000000003CD4D48) ((module-name not available)): (filename not available): (function-name not available) + 0x0
所以我知道它导致崩溃的新UI,但我不知道如何修复。
我在某些脚本中using UnityEngine.UI;
来访问UI文本并进行更改。 IE scoreText.text = "Score: " + score;
我禁用了脚本中的所有代码并访问了UnityEngine.UI;
,但这也无效。关于如何解决这个问题的任何想法?
答案 0 :(得分:0)
所以我发现这个日文网站并为我修复了解决方案, 基本上不使用Unity字体,Arial工作正常,但其他任何东西都不起作用(Lucida Granda)。 希望它有所帮助。