您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
38 行
1.3 KiB
38 行
1.3 KiB
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace UnityEditor.Graphing
|
|
{
|
|
public interface IGraph : IOnAssetEnabled
|
|
{
|
|
IEnumerable<T> GetNodes<T>() where T : INode;
|
|
IEnumerable<IEdge> edges { get; }
|
|
void AddNode(INode node);
|
|
void RemoveNode(INode node);
|
|
IEdge Connect(SlotReference fromSlotRef, SlotReference toSlotRef);
|
|
void RemoveEdge(IEdge e);
|
|
void RemoveElements(IEnumerable<INode> nodes, IEnumerable<IEdge> edges);
|
|
INode GetNodeFromGuid(Guid guid);
|
|
bool ContainsNodeGuid(Guid guid);
|
|
T GetNodeFromGuid<T>(Guid guid) where T : INode;
|
|
void GetEdges(SlotReference s, List<IEdge> foundEdges);
|
|
void ValidateGraph();
|
|
void ReplaceWith(IGraph other);
|
|
IGraphObject owner { get; set; }
|
|
IEnumerable<INode> addedNodes { get; }
|
|
IEnumerable<INode> removedNodes { get; }
|
|
IEnumerable<IEdge> addedEdges { get; }
|
|
IEnumerable<IEdge> removedEdges { get; }
|
|
void ClearChanges();
|
|
}
|
|
|
|
public static class GraphExtensions
|
|
{
|
|
public static IEnumerable<IEdge> GetEdges(this IGraph graph, SlotReference s)
|
|
{
|
|
var edges = new List<IEdge>();
|
|
graph.GetEdges(s, edges);
|
|
return edges;
|
|
}
|
|
}
|
|
}
|