Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

MeshEffects setvertex does not work with other text effects

Discussion in 'UGUI & TextMesh Pro' started by Seraphim-Whiteless, Jul 19, 2017.

  1. Seraphim-Whiteless

    Seraphim-Whiteless

    Joined:
    Jun 23, 2014
    Posts:
    197
    Hi everyone!

    Unity 5.6.2

    Why Outline and Shadow effects broke other MeshEffects?

    in this line while setting vertex?
    helper.SetUIVertex(v, i);


    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[UnityEngine.Vector2].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    UnityEngine.UI.VertexHelper.PopulateUIVertex (UnityEngine.UIVertex& vertex, Int32 i) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Utility/VertexHelper.cs:65)
    Rounded.ModifyMesh (UnityEngine.UI.VertexHelper helper) (at Assets/Rounded.cs:34)
    UnityEngine.UI.Graphic.DoMeshGeneration () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:388)
    UnityEngine.UI.Graphic.UpdateGeometry () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:374)
    UnityEngine.UI.Text.UpdateGeometry () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Text.cs:378)
    UnityEngine.UI.Graphic.Rebuild (CanvasUpdate update) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:335)
    UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:149)
    UnityEngine.Canvas:SendWillRenderCanvases()
     
    Last edited: Jul 19, 2017
  2. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,688
    Simply reorder the components. Had this issue raised on the UI Extensions project (link in sig) and had to find a programmatic way to automatically reorder the effect components. Simply put, the Unity one's need to be at the bottom of your component list.
    Any changes to the BaseMesh must be done BEFORE the Unity effects.

    Hope this helps.
     
  3. gaosubo

    gaosubo

    Joined:
    Aug 23, 2017
    Posts:
    1
    I also encountered this problem!!what is BaseMesh??? and what is Unity effects???Beg you, tell me @SimonDarksideJ