mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-29 23:41:54 +08:00
refactor(TickTool): 简化until方法的对象有效性检查
移除临时变量obj,直接在循环条件中调用predicate.get_object(),使代码更简洁
This commit is contained in:
@@ -6,8 +6,7 @@ static func frame(count: int = 1):
|
||||
for i in range(count):
|
||||
await WorldManager.tree.physics_frame
|
||||
static func until(predicate: Callable):
|
||||
var obj = predicate.get_object()
|
||||
while is_instance_valid(obj):
|
||||
while is_instance_valid(predicate.get_object()):
|
||||
if predicate.call():
|
||||
break
|
||||
await frame()
|
||||
|
||||
Reference in New Issue
Block a user