我用的godot4.2.1stable,在macOS13上开发,给area2d绑定一个信号测试时程序直接闪退然后报错,我不知道是我的逻辑有问题还是其他造成的。
public void logStatus(Area2D area2)
{//test
if(Input.IsActionJustPressed("left_mouse_press"))
{
hP-=1;
}
GD.Print("Hero HP: ", hP);
GD.Print("Hero phyDefensePoint: ", phyDefensePoint);
}
public override void _Ready()
{
base._Ready();
area2D.Connect("area_entered", new Callable(this, "logStatus"));
}