1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-06-23 03:52:30 +08:00

refactor(TickTool): 简化until方法的对象有效性检查

移除临时变量obj,直接在循环条件中调用predicate.get_object(),使代码更简洁
This commit is contained in:
2026-01-28 22:51:28 +08:00
parent 0ab500c362
commit 2db1f7ac26
+1 -2
View File
@@ -6,8 +6,7 @@ static func frame(count: int = 1):
for i in range(count): for i in range(count):
await WorldManager.tree.physics_frame await WorldManager.tree.physics_frame
static func until(predicate: Callable): static func until(predicate: Callable):
var obj = predicate.get_object() while is_instance_valid(predicate.get_object()):
while is_instance_valid(obj):
if predicate.call(): if predicate.call():
break break
await frame() await frame()