[Unity]ArgumentException: Mesh can not have more than 65000 vertices

2020/05 27 20:05

在使用UGUI制作时,当大量的文本使用了Outline和Shadow,则可能会报以下错误:

ArgumentException: Mesh can not have more than 65000 vertices
UnityEngine.UI.VertexHelper.FillMesh (UnityEngine.Mesh mesh) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Utility/VertexHelper.cs:206)
UnityEngine.UI.Graphic.DoMeshGeneration () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:591)
UnityEngine.UI.Graphic.UpdateGeometry () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:573)
UnityEngine.UI.Text.UpdateGeometry () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Text.cs:571)
UnityEngine.UI.Graphic.Rebuild (UnityEngine.UI.CanvasUpdate update) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:534)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:198)
UnityEngine.Canvas:SendWillRenderCanvases() (at C:/buildslave/unity/build/Runtime/UI/ScriptBindings/UICanvas.bindings.cs:72)

说明顶点撑爆了,描边和阴影很费顶点

2 Comments

  1. #1

    吴尹

    4years ago -@

    大哥。这个问题怎么解决啊。我快疯了。

    • shaojingliu

      4years ago -@

      @吴尹 方案1、写自己的阴影表现Shader
      方案2、使用阴影或者描边的字不要太多