Exemplo n.º 1
0
        public bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera)
        {
            if (!enabled)
            {
                return(true);
            }

            Vector2 local;

            RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, screenPoint, eventCamera,
                                                                    out local);

            Rect rect = rectTransform.rect;

            // Convert top left corner as reference origin point.
            local.x += rectTransform.pivot.x * rect.width;
            local.y -= rectTransform.pivot.y * rect.height;
            local.x  = local.x / (_currentDevicePixelRatio / canvas.scaleFactor);
            local.y  = -local.y / (_currentDevicePixelRatio / canvas.scaleFactor);

            return(!RaycastManager.CheckCastThrough(windowHashCode, local));
        }
Exemplo n.º 2
0
 public override void mainEntry()
 {
     base.mainEntry();
     windowHashCode = wrapper.isolate.GetHashCode();
     RaycastManager.NewWindow(windowHashCode);
 }
Exemplo n.º 3
0
 protected override void OnRectTransformDimensionsChange()
 {
     base.OnRectTransformDimensionsChange();
     RaycastManager.OnScreenSizeChanged(windowHashCode);
 }
Exemplo n.º 4
0
 protected override void OnDisable()
 {
     base.OnDisable();
     RaycastManager.DisposeWindow(windowHashCode);
 }
Exemplo n.º 5
0
 public override void unmount()
 {
     RaycastManager.RemoveFromList(widgetHashCode, windowHashCode);
     base.unmount();
 }
Exemplo n.º 6
0
 public override void update(Widget newWidget)
 {
     RaycastManager.MarkDirty(widgetHashCode, windowHashCode);
     base.update(newWidget);
 }
Exemplo n.º 7
0
 public override void mount(Element parent, object newSlot)
 {
     widgetHashCode = widget.GetHashCode();
     RaycastManager.AddToList(widgetHashCode, windowHashCode);
     base.mount(parent, newSlot);
 }
Exemplo n.º 8
0
        public override void paint(PaintingContext context, Offset offset)
        {
            RaycastManager.UpdateSizeOffset(widgetHashCode, windowHashCode, size, offset);

            base.paint(context, offset);
        }