gefällt mir
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using Godot;
|
||||
using yourareanaiceo;
|
||||
|
||||
[SceneTree]
|
||||
public partial class MeetingPhysicsBox : RigidBody2D
|
||||
@@ -15,12 +13,10 @@ public partial class MeetingPhysicsBox : RigidBody2D
|
||||
public override void _Ready()
|
||||
{
|
||||
FreezeMode = FreezeModeEnum.Kinematic;
|
||||
Modulate = MeetingResource.Color;
|
||||
|
||||
MeetingControlGfx.MeetingTitle.Text = MeetingResource.Title;
|
||||
|
||||
MouseEntered += () =>
|
||||
{
|
||||
GD.Print("Mouse Entered");
|
||||
_mouseInside = true;
|
||||
CanSleep = false;
|
||||
};
|
||||
@@ -29,19 +25,23 @@ public partial class MeetingPhysicsBox : RigidBody2D
|
||||
_mouseInside = false;
|
||||
CanSleep = true;
|
||||
};
|
||||
|
||||
MeetingControlGfx.MeetingResource = MeetingResource;
|
||||
}
|
||||
|
||||
public override void _UnhandledInput(InputEvent @event)
|
||||
{
|
||||
// TODO: probably memory problem
|
||||
if (@event is InputEventMouse mouseEvent)
|
||||
using (@event)
|
||||
{
|
||||
if (_mouseInside)
|
||||
if (@event is InputEventMouse mouseEvent)
|
||||
{
|
||||
if (mouseEvent.IsPressed() && mouseEvent.ButtonMask == MouseButtonMask.Left)
|
||||
if (_mouseInside)
|
||||
{
|
||||
GD.Print("Start Dragging");
|
||||
StartDragging();
|
||||
if (mouseEvent.IsPressed() && mouseEvent.ButtonMask == MouseButtonMask.Left)
|
||||
{
|
||||
GD.Print("Start Dragging");
|
||||
StartDragging();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user