新增了对NodeaAction特性标记方法中,对params可变参数的支持

This commit is contained in:
fengjiayi
2024-11-02 22:11:38 +08:00
parent cd1642dcf7
commit 8b4ec31d83
15 changed files with 472 additions and 169 deletions

View File

@@ -1316,7 +1316,28 @@ namespace Serein.NodeFlow.Env
}
/// <summary>
/// 改变可选参数的数目
/// </summary>
/// <param name="nodeGuid">对应的节点Guid</param>
/// <param name="isAdd">true增加参数false减少参数</param>
/// <param name="paramIndex">以哪个参数为模板进行拷贝,或删去某个参数(该参数必须为可选参数)</param>
/// <returns></returns>
public async Task<bool> ChangeParameter(string nodeGuid, bool isAdd, int paramIndex)
{
var nodeModel = GuidToModel(nodeGuid);
if (nodeModel is null) return false;
bool isPass;
if (isAdd)
{
isPass = nodeModel.MethodDetails.AddParamsArg(paramIndex);
}
else
{
isPass = nodeModel.MethodDetails.RemoveParamsArg(paramIndex);
}
return isPass;
}
/// <summary>