gpt4 book ai didi

c# - Unity 4.6p1 UI 在任何版本中崩溃

转载 作者:行者123 更新时间:2023-12-01 19:06:55 27 4
gpt4 key购买 nike

我将 (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 导致了崩溃,但我不知道如何修复。

我在某些脚本中使用 UnityEngine.UI; 来访问 UI 文本并更改它。 IE scoreText.text = "分数:"+ 分数;

我禁用了脚本中的所有代码以及访问UnityEngine.UI;的代码,但这也不起作用。关于如何解决这个问题有什么想法吗?

最佳答案

所以我找到了这个日本网站并为我解决了解决方案,基本上不使用 Unity 字体,Arial 工作正常,但其他任何字体都不起作用(Lucida Granda)。希望对您有所帮助。

关于c# - Unity 4.6p1 UI 在任何版本中崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27324330/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com