text Godot Quick Tips 01:用于等待X秒的create_timer()助手

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text Godot Quick Tips 01:用于等待X秒的create_timer()助手相关的知识,希望对你有一定的参考价值。

# Available only in the 2.2 legacy branch and posterior versions

func _ready():

	# The old way:
	print("HELLO") 			# Code before the yield
	# Setting up the yield:
	var t = Timer.new() 		# Create a new Timer node
	t.set_wait_time(5.5) 		# Set the wait time
	add_child(t)			# Add it to the node tree as the direct child
	t.start()			# Start it
	yield(t, "timeout")		# Finally, make the script stop with the yield
	print("WORLD")			# Code that will be exectued after the yield
	print("=====")
	
	
	# The optional new way:
	
	print("HELLO AGAIN!") 		# Code before the yield
	
	# Setting up the yield with the new function 'create_timer()':
	yield(get_tree().create_timer(5.5),"timeout")
	print("WORLD")			# Code that will be exectued after the yield

以上是关于text Godot Quick Tips 01:用于等待X秒的create_timer()助手的主要内容,如果未能解决你的问题,请参考以下文章

text 在Godot Engine的应用程序购买中:示例

css 来自http://www.wearesicc.com/quick-tips-5-column-layout-with-twitter-bootstrap/

css Boostrap 3媒体查询 - https://scotch.io/quick-tips/default-sizes-for-twitter-bootstraps-media-querie

Godot:如何垂直对齐bbcode

Godot FunctionTree 功能树 简单使用教程

Godot FunctionTree 功能树 简单使用教程