Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

If root canvas is disabled ,the child canvas' GraphicRaycast will always generate events.

Discussion in 'UGUI & TextMesh Pro' started by ywq, Feb 3, 2015.

  1. ywq

    ywq

    Joined:
    Aug 22, 2012
    Posts:
    15
    When root canvas is disabled, the child canvas will render nothing even it is enabled. But GraphicRaycast will always generate events. Is it wrong?
    Becuase root canvas will disable child canvas,so I think canvas needs a Canvas.enabledInHierarchy, just like GameObject.activeInHierarchy.
     
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    please report a bug, just disabling the parent shouldn't prevent the children from drawing (i dont think).
     
  3. ywq

    ywq

    Joined:
    Aug 22, 2012
    Posts:
    15
    I'm sorry, I made a mistake. I set CanvasGroup.alpha=0 before disabling the parent canvas.
    You are right,parent doesn't prevent the children from drawing.
    But I find if I disable root canvas which render mode is screen space overlay, the child canvas will render the graphics in world space mode.Is it a bug?
     
  4. phil-Unity

    phil-Unity

    Unity UI Lead Developer Unity Technologies

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    if it actually rendering in world space mode yes that would be a bug. But i'm guess its more still rendering with the hierarchy of the disabled parents (which is correct).