添加了教育平台

This commit is contained in:
CortexCore
2023-06-29 01:01:52 +08:00
parent 254e8ccde8
commit dd10fb59e5
128 changed files with 5270 additions and 166 deletions

View 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);
}
}

View File

@@ -0,0 +1,18 @@
using Godot;
using System;
namespace BITKit;
public partial class GraphNodeConnector : GraphEdit
{
// public override bool _IsNodeHoverValid(StringName fromNode, int fromPort, StringName toNode, int toPort)
// {
// //return base._IsNodeHoverValid(fromNode, fromPort, toNode, toPort);
// ConnectNode(fromNode, fromPort, toNode, toPort);
// return true;
// }
private void RequestConnection(StringName fromNode, int fromPort, StringName toNode, int toPort)
{
ConnectNode(fromNode, fromPort, toNode, toPort);
}
}