添加了教育平台
This commit is contained in:
36
BITKit/Scripts/GraphNode/GraphFlowService.cs
Normal file
36
BITKit/Scripts/GraphNode/GraphFlowService.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace BITKit;
|
||||
public partial class GraphFlowService : Node
|
||||
{
|
||||
[Export] private Godot.Collections.Dictionary<int,NodePath> nodes;
|
||||
[Export] private int currentIndex = -1;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
if (currentIndex is not -1 && currentIndex < nodes.Count)
|
||||
Entry(GetGraphNode(nodes[currentIndex]));
|
||||
}
|
||||
|
||||
private void EntryNext()
|
||||
{
|
||||
if ((currentIndex + 1) >= nodes.Count) return;
|
||||
currentIndex++;
|
||||
Entry(GetGraphNode(nodes[currentIndex]));
|
||||
}
|
||||
private void Entry(GraphNode node)
|
||||
{
|
||||
foreach (var _node in nodes)
|
||||
{
|
||||
GetGraphNode(_node.Value).Overlay = GraphNode.OverlayEnum.Disabled;
|
||||
}
|
||||
node.Overlay = GraphNode.OverlayEnum.Position;
|
||||
}
|
||||
|
||||
GraphNode GetGraphNode(string nodePath)
|
||||
{
|
||||
return GetNode<GraphNode>(nodePath);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user