Пример #1
0
    void Update()
    {
        Vector3 mousePos;
        bool    isTouchedNow = ClickRayCaster.Instance.MouseOn(this, out mousePos);

        if (!IsTouched && isTouchedNow)
        {
            OnMouseOn?.Invoke(this, new MouseEventArgs(true, mousePos));
            MouseIn = true;
        }
        else
        {
            MouseIn = false;
        }
        if (IsTouched && !isTouchedNow)
        {
            OnMouseOut?.Invoke(this, new MouseEventArgs(false, new Vector3()));
            MouseOut = false;
        }
        else
        {
            MouseOut = false;
        }
        IsTouched = isTouchedNow;
    }
Пример #2
0
 public virtual void MouseOut(UIMouseEvent e)
 {
     //Main.NewText("离开");
     IsMouseHover = false;
     OnMouseOut?.Invoke(e, this);
     if (PropagationRule.HasFlag(PropagationFlags.MouseOut))
     {
         Parent?.MouseOut(e);
     }
 }
Пример #3
0
 public virtual void MouseOut(MouseEventArgs e)
 {
     if (Enabled && Hovered)
     {
         if (!EffectiveBounds.Contains(e.Position))
         {
             Hovered = false;
             OnMouseOut?.Invoke(this, EventArgs.Empty);
         }
     }
 }
        internal void DispatchEvent(Map map, HtmlMarkerJsEventArgs eventArgs)
        {
            if (eventArgs.Options != null)
            {
                var popupOptions = Options.Popup;
                Options       = eventArgs.Options;
                Options.Popup = popupOptions;
            }

            switch (eventArgs.Type)
            {
            case "click":
                OnClick?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "contextmenu":
                OnContextMenu?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "dblclick":
                OnDblClick?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "drag":
                OnDrag?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "dragend":
                OnDragEnd?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "dragstart":
                OnDragStart?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "keydown":
                OnKeyDown?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "keypress":
                OnKeyPress?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "keyup":
                OnKeyUp?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mousedown":
                OnMouseDown?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mouseenter":
                OnMouseEnter?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mouseleave":
                OnMouseLeave?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mousemove":
                OnMouseMove?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mouseout":
                OnMouseOut?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mouseover":
                OnMouseOver?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;

            case "mouseup":
                OnMouseUp?.Invoke(new HtmlMarkerEventArgs(map, eventArgs.Type, this));
                break;
            }
        }
Пример #5
0
 public virtual void MouseOut(UIMouseEvent evt)
 {
     MouseHovering = false;
     OnMouseOut?.Invoke(evt, this);
     Parent?.MouseOut(evt);
 }
        internal void DispatchEvent(Map map, MapJsEventArgs eventArgs)
        {
            switch (eventArgs.Type)
            {
            case "click":
                OnClick?.Invoke(new MapMouseEventArgs(map, eventArgs));
                break;

            case "contextmenu":
                OnContextMenu?.Invoke(new MapMouseEventArgs(map, eventArgs));
                break;

            case "dblclick":
                OnDblClick?.Invoke(new MapMouseEventArgs(map, eventArgs));
                break;

            case "layeradded":
                OnLayerAdded?.Invoke(new MapEventArgs(map, eventArgs.Type));
                break;

            case "layerremoved":
                OnLayerRemoved?.Invoke(new MapEventArgs(map, eventArgs.Type));
                break;

            case "mousedown":
                OnMouseDown?.Invoke(new MapMouseEventArgs(map, eventArgs));
                break;

            case "mouseenter":
                OnMouseEnter?.Invoke(new MapMouseEventArgs(map, eventArgs));
                break;

            case "mouseleave":
                OnMouseLeave?.Invoke(new MapMouseEventArgs(map, eventArgs));
                break;

            case "mousemove":
                OnMouseMove?.Invoke(new MapMouseEventArgs(map, eventArgs));
                break;

            case "mouseout":
                OnMouseOut?.Invoke(new MapMouseEventArgs(map, eventArgs));
                break;

            case "mouseover":
                OnMouseOver?.Invoke(new MapMouseEventArgs(map, eventArgs));
                break;

            case "mouseup":
                OnMouseUp?.Invoke(new MapMouseEventArgs(map, eventArgs));
                break;

            case "touchcancel":
                OnTouchCancel?.Invoke(new MapTouchEventArgs(map, eventArgs));
                break;

            case "touchend":
                OnTouchEnd?.Invoke(new MapTouchEventArgs(map, eventArgs));
                break;

            case "touchmove":
                OnTouchMove?.Invoke(new MapTouchEventArgs(map, eventArgs));
                break;

            case "touchstart":
                OnTouchStart?.Invoke(new MapTouchEventArgs(map, eventArgs));
                break;

            case "wheel":
                OnWheel?.Invoke(new MapEventArgs(map, eventArgs.Type));
                break;
            }
        }
Пример #7
0
 public void NotifyMouseOut(MouseEvent eventArgs)
 {
     OnMouseOut?.Invoke(this, eventArgs);
 }
Пример #8
0
 public virtual void MouseOut(UIMouseEventArgs e)
 {
     MouseHovering = false;
     OnMouseOut?.Invoke(this, e);
     Parent?.MouseOut(e);
 }
Пример #9
0
 public void MouseOut(UIMouseEventData e)
 {
     OnMouseOut?.Invoke(e);
 }