【a】可视化剧本编辑器 10.StoryEditor
This commit is contained in:
38
Assets/10.StoryEditor/RunTime/Player/Node/EndNodePlayer.cs
Normal file
38
Assets/10.StoryEditor/RunTime/Player/Node/EndNodePlayer.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Stary.Evo.StoryEditor
|
||||
{
|
||||
public class EndNodePlayer : NodePlayer
|
||||
{
|
||||
public new EndNodeData Data;
|
||||
|
||||
public List<NodePlayer> Pre = new();
|
||||
|
||||
public EndNodePlayer(GraphPlayer graph, EndNodeData data) : base(graph, data)
|
||||
{
|
||||
Data = data;
|
||||
}
|
||||
|
||||
public override bool Connect()
|
||||
{
|
||||
if(!base.Connect())
|
||||
return false;
|
||||
|
||||
Data.pre.ForEach(index => Pre.Add(Graph.Nodes[index]));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override UniTask Execute()
|
||||
{
|
||||
Init();
|
||||
Debug.Log($"剧本执行完成: {Graph.Name}");
|
||||
// 标记剧本完成
|
||||
Graph.Finished = true;
|
||||
ScriptPlayer.ReleaseGraph();
|
||||
return base.Execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user