Beispiel #1
0
 protected override void OnMouseDown(int button)
 {
     base.OnMouseDown(button);
     status = ButtonSatus.Press;
     if (PressEvent != null)
     {
         PressEvent(this, true);
     }
 }
Beispiel #2
0
 protected override void OnMouseUp(int button)
 {
     base.OnMouseUp(button);
     if (ClickEvent != null)
     {
         ClickEvent(this);
     }
     if (PressEvent != null && status == ButtonSatus.Press)
     {
         PressEvent(this, false);
     }
     status = ButtonSatus.Normal;
 }
Beispiel #3
0
 protected override void OnMouseEnter(Vector2 position)
 {
     //Debug.Log("Enter");
     base.OnMouseEnter(position);
     if (status != ButtonSatus.Press)
     {
         status = ButtonSatus.Hover;
         if (HoverEvent != null)
         {
             HoverEvent(this, true);
         }
     }
 }
Beispiel #4
0
 protected override void OnMouseLeave(Vector2 position)
 {
     //Debug.Log("Leave");
     base.OnMouseLeave(position);
     if (PressEvent != null && status == ButtonSatus.Press)
     {
         PressEvent(this, false);
     }
     status = ButtonSatus.Normal;
     if (HoverEvent != null)
     {
         HoverEvent(this, false);
     }
 }