一个很简单系统自动生成的代码,运行后就发生警告,虽然警告不是什么致命错误,但是也挺烦的。
代码如下:
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_button_pressed() -> void:
$HTTPRequest.request('http://www.cx06.com')
警告:
W 0:00:00:0649 The parameter "delta" is never used in the function "_process()". If this is intended, prefix it with an underscore: "_delta".
<GDScript 错误> UNUSED_PARAMETER
<GDScript 源文件> node_2d.gd:10
翻译:
W 0:00:01:0240函数“_process()”中从不使用参数“delta”。如果是这样,请在它前面加一个下划线:“_delta”。
<GDScript错误>未使用_参数
<GDScript源文件>node_2d.gd:10
最终理解:这里的意思是,delta未使用所以,前面加个_,意思未使用的参数变成_delta。
不得不说,godot作者有强迫症。
直接放心忽略即可