Search Unity

Force RectMask2D to use arbitrary rectangle instead of it's rect transform

Discussion in 'Scripting' started by palex-nx, Jun 26, 2019.

  1. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    I've tried many approaches, but have not succeeded. And I can't just inherit RectMask2D and replace CanvasRect property which would be enough as it is not marked as virtual. So what should I do?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,740
  3. palex-nx

    palex-nx

    Joined:
    Jul 23, 2018
    Posts:
    1,748
    Yes. There's a lot of interaction in hierarchy between parent and child masks and it relies on some helper classes and they all works only for RectMask2D, so i forced to inherit it if i want masks to work correctly in hierarchy. And I can't because they acess that non-virtual canvasRect.