コード例 #1
0
        public bool IsRaycastLocationValid(Vector2 screenPoint, Camera eventCamera)
        {
            if (!this.enabled)
            {
                return(true);
            }

            Vector2 local;

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

            Rect rect = this.rectTransform.rect;

            // Convert top left corner as reference origin point.
            local.x += this.rectTransform.pivot.x * rect.width;
            local.y -= this.rectTransform.pivot.y * rect.height;
            local.x  = local.x / this.devicePixelRatio;
            local.y  = -local.y / this.devicePixelRatio;

            return(!RaycastManager.CheckCastThrough(this.windowHashCode, local));
        }
コード例 #2
0
 public override void unmount()
 {
     RaycastManager.RemoveFromList(widgetHashCode, windowHashCode);
     base.unmount();
 }
コード例 #3
0
 public override void update(Widget newWidget)
 {
     RaycastManager.MarkDirty(widgetHashCode, windowHashCode);
     base.update(newWidget);
 }
コード例 #4
0
 public override void mount(Element parent, object newSlot)
 {
     widgetHashCode = widget.GetHashCode();
     RaycastManager.AddToList(widgetHashCode, windowHashCode);
     base.mount(parent, newSlot);
 }
コード例 #5
0
        public override void paint(PaintingContext context, Offset offset)
        {
            RaycastManager.UpdateSizeOffset(widgetHashCode, windowHashCode, size, offset);

            base.paint(context, offset);
        }
コード例 #6
0
 protected override void InitWindowAdapter()
 {
     base.InitWindowAdapter();
     this.windowHashCode = this.window.GetHashCode();
     RaycastManager.NewWindow(this.windowHashCode);
 }
コード例 #7
0
 protected override void OnDisable()
 {
     base.OnDisable();
     RaycastManager.DisposeWindow(this.windowHashCode);
 }