Search Unity

  1. Improved Prefab workflow (includes Nested Prefabs!), 2D isometric Tilemap and more! Get the 2018.3 Beta now.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Let us know a bit about your interests, and if you'd like to become more directly involved. Take our survey!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice
  5. 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:
    3,021
    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:
    3,021
    The original bug was fixed last year. It sounds like you have found something new. Can you file a bug report please?