mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-23 19:24:29 +08:00
feat(signal): 添加信号连接并立即调用功能
- 实现 ToAndCall 方法连接信号到指定可调用对象 - 支持传递参数并在连接后立即执行调用 - 返回当前构建器实例以支持链式调用 - 完善方法注释文档说明功能用途 - 保持原有 API 结构不变确保兼容性
This commit is contained in:
parent
2bc5a08d74
commit
98f343d78e
@ -38,6 +38,19 @@ public sealed class SignalBuilder(GodotObject target, StringName signal)
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 连接信号到指定的可调用对象并立即调用
|
||||
/// </summary>
|
||||
/// <param name="callable">要连接的可调用对象</param>
|
||||
/// <param name="args">调用参数</param>
|
||||
/// <returns>当前构建器实例</returns>
|
||||
public SignalBuilder ToAndCall(Callable callable, params Variant[] args)
|
||||
{
|
||||
To(callable);
|
||||
callable.Call(args);
|
||||
return this;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 显式结束,返回 Node
|
||||
/// </summary>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user