コード例 #1
0
ファイル: EventMenuController.cs プロジェクト: pyneer/case
 void Button_Down(object sender, Duality.Input.MouseButtonEventArgs e)
 {
     // did I click the left button and am I hovering a component? do something!
     if (e.Button == Duality.Input.MouseButton.Left && this.currentComponent != null)
     {
         this.currentComponent.DoAction();
     }
 }
コード例 #2
0
        private void Mouse_ButtonDown(object sender, Duality.Input.MouseButtonEventArgs e)
        {
            if (DualityApp.Mouse.ButtonPressed(Duality.Input.MouseButton.Left))
            {
                Camera cam = GameObj.GetComponent <Camera>();

                cam.RenderPickingMap(new Point2(DualityApp.UserData.GfxWidth, DualityApp.UserData.GfxHeight), false);
                ICmpRenderer clicked = cam.PickRendererAt(DualityApp.Mouse.X, DualityApp.Mouse.Y);
                if (clicked != null && clicked is SpriteRenderer)
                {
                    SpriteRenderer r         = clicked as SpriteRenderer;
                    IClickable     clickable = r.GameObj.GetComponent <IClickable>();
                    if (clickable != null)
                    {
                        clickable.RespondToClick(MouseArgs.LeftButton);
                    }
                }
            }
        }
コード例 #3
0
ファイル: LocalInput.cs プロジェクト: generatives/Battleroom
 private void Mouse_ButtonDown(object sender, Duality.Input.MouseButtonEventArgs e)
 {
     Beam.IsFiring = true;
 }
コード例 #4
0
ファイル: LocalInput.cs プロジェクト: generatives/Battleroom
 private void Mouse_ButtonUp(object sender, Duality.Input.MouseButtonEventArgs e)
 {
     Beam.IsFiring = false;
 }