Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Deleted

Discussion in 'Unity UI & TextMesh Pro' started by qiankanglai, Mar 11, 2016.

  1. qiankanglai

    qiankanglai

    Joined:
    Jun 8, 2013
    Posts:
    22
    Deleted
     
    Last edited: Mar 25, 2018
  2. JoaoPaul54

    JoaoPaul54

    Joined:
    Nov 20, 2013
    Posts:
    52
    I can attest to this bug... in my project, the only workaround I found was when an item is updated and I expect him to be out of the mask I would create a clone of it and delete the old one
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    2,903
    This was fixed the other day. It should be in an upcoming fix but if you want it now you can download the UI source code and apply this change:

    Code (CSharp):
    1. diff --git a/Extensions/guisystem/UnityEngine.UI/UI/Core/MaskableGraphic.cs b/Extensions/guisystem/UnityEngine.UI/UI/Core/MaskableGraphic.cs
    2. --- a/Extensions/guisystem/UnityEngine.UI/UI/Core/MaskableGraphic.cs
    3. +++ b/Extensions/guisystem/UnityEngine.UI/UI/Core/MaskableGraphic.cs
    4. @@ -91,6 +91,11 @@ namespace UnityEngine.UI
    5.                  return;
    6.              var cull = !validRect || !clipRect.Overlaps(canvasRect, true);
    7. +            UpdateCull(cull);
    8. +        }
    9. +
    10. +        private void UpdateCull(bool cull)
    11. +        {
    12.              var cullingChanged = canvasRenderer.cull != cull;
    13.              canvasRenderer.cull = cull;
    14. @@ -196,7 +201,10 @@ namespace UnityEngine.UI
    15.              var newParent = (maskable && IsActive()) ? MaskUtilities.GetRectMaskForClippable(this) : null;
    16.              if (newParent != m_ParentMask && m_ParentMask != null)
    17. +            {
    18.                  m_ParentMask.RemoveClippable(this);
    19. +                UpdateCull(false);
    20. +            }
    21.              if (newParent != null)
    22.                  newParent.AddClippable(this);
     
  4. JoaoPaul54

    JoaoPaul54

    Joined:
    Nov 20, 2013
    Posts:
    52
    Awesome :) Both the fix and the "way less horrible" workaround :)

    I'm updating my code with this workaround and wait for the patch to hit Unity as I cannot use the source code (company GIT and so on... :/ )
     
  5. Shadeless

    Shadeless

    Joined:
    Jul 22, 2013
    Posts:
    136
    @karl_jones
    Just found this thread and I have a similar issue.
    Using Mask works for me but using RectMask2D doesn't work in Play Mode for some reason.
    Basically set the scene up so UI elements aren't visible from the Mask. Then enter Play Mode and modify the RectMask2D Rect Transform so they become visible (I modified the size), but they don't show up. They remain culled I guess?

    Anyway just wanted to tell you about it. I'm using 5.5.0f3 btw.
     
  6. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    2,903
    The original bug was fixed last year. It sounds like you have found something new. Can you file a bug report please?