예제 #1
0
    private static bool IsMouseAction(MouseTrigger a, MouseButtonEventArgs e, int clickCount)
    {
        if (clickCount != TriggerClickCount(a))
        {
            return(false);
        }

        if (a == MouseTrigger.LeftClick && e.ChangedButton == MouseButton.Left)
        {
            return(true);
        }

        if (a == MouseTrigger.MiddleClick && e.ChangedButton == MouseButton.Middle)
        {
            return(true);
        }

        if (a == MouseTrigger.RightClick && e.ChangedButton == MouseButton.Right)
        {
            return(true);
        }
        else
        {
            return(false);
        }
    }
예제 #2
0
 public override void Init()
 {
     stateHandle.Init();
     stateHandle.AsyncState(_state);
     mTrigger          = GetComponent <MouseTrigger>();
     mTrigger.onEnter += Ontrigger;
     mTrigger.onExit  += Ontrigger;
     mTrigger.onDown  += Ontrigger;
     mTrigger.onUp    += Ontrigger;
     SetGlobalLock(false);
     SetPrivateLock(false);
 }
예제 #3
0
 /// <summary>
 /// Returns the amount of clicks represented by specified mouse trigger.
 /// </summary>
 private int TriggerClickCount(MouseTrigger a)
 {
     if (a == MouseTrigger.None)
     {
         return(0);
     }
     else if (a == MouseTrigger.LeftClick || a == MouseTrigger.MiddleClick || a == MouseTrigger.RightClick)
     {
         return(1);
     }
     else
     {
         return(2);
     }
 }
예제 #4
0
    private static bool IsMouseAction(MouseTrigger a, MouseButton button, int clickCount)
    {
        if (clickCount != TriggerClickCount(a))
        {
            return(false);
        }

        if (a == MouseTrigger.LeftClick && button == MouseButton.Left)
        {
            return(true);
        }

        if (a == MouseTrigger.MiddleClick && button == MouseButton.Middle)
        {
            return(true);
        }

        if (a == MouseTrigger.RightClick && button == MouseButton.Right)
        {
            return(true);
        }

        return(false);
    }
예제 #5
0
파일: ZPoint.cs 프로젝트: mxgmn/GENW
 public bool IsIn(MouseTrigger t)
 {
     return x >= t.position.x && y >= t.position.y && x <= t.position.x + t.size.x && y <= t.position.y + t.size.y;
 }