修改了很多

This commit is contained in:
fengjiayi
2024-10-27 00:54:10 +08:00
parent 6f26d303e4
commit cb2553ac69
66 changed files with 2215 additions and 1402 deletions

View File

@@ -47,6 +47,10 @@ namespace Serein.Library.Core.NodeFlow
/// <returns></returns>
public object? GetFlowData(string nodeGuid)
{
if (string.IsNullOrEmpty(nodeGuid))
{
return null;
}
if(dictNodeFlowData.TryGetValue(nodeGuid,out var data))
{
return data;
@@ -70,8 +74,18 @@ namespace Serein.Library.Core.NodeFlow
/// <summary>
/// 结束流程
/// </summary>
public void EndCurrentBranch()
public void Exit()
{
foreach (var nodeObj in dictNodeFlowData.Values)
{
if (nodeObj is not null)
{
if (typeof(IDisposable).IsAssignableFrom(nodeObj?.GetType()) && nodeObj is IDisposable disposable)
{
disposable?.Dispose();
}
}
}
this.dictNodeFlowData?.Clear();
RunState = RunState.Completion;
}