using System.Collections.Generic; using Cysharp.Threading.Tasks; using UnityEngine; namespace Stary.Evo.StoryEditor { public class EndNodePlayer : NodePlayer { public new EndNodeData Data; public List 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(); } } }