public static int GetStencilID(GameObject obj)
        {
            int       num       = 0;
            Transform transform = obj.transform;
            Transform y         = TMP_MaterialManager.FindRootSortOverrideCanvas(transform);

            if (transform == y)
            {
                return(num);
            }
            Transform   parent = transform.parent;
            List <Mask> list   = TMP_ListPool <Mask> .Get();

            while (parent != null)
            {
                parent.GetComponents <Mask>(list);
                for (int i = 0; i < list.Count; i++)
                {
                    Mask mask = list[i];
                    if (mask != null && mask.MaskEnabled() && mask.graphic.IsActive())
                    {
                        num++;
                        break;
                    }
                }
                if (parent == y)
                {
                    break;
                }
                parent = parent.parent;
            }
            TMP_ListPool <Mask> .Release(list);

            return(Mathf.Min((1 << num) - 1, 255));
        }