You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
701 B
27 lines
701 B
2 years ago
|
using System.Linq;
|
||
|
using UnityEditor.Graphing;
|
||
|
|
||
|
namespace UnityEditor.ShaderGraph
|
||
|
{
|
||
|
readonly struct GraphDataReadOnly
|
||
|
{
|
||
|
private readonly GraphData m_Graph;
|
||
|
|
||
|
public GraphDataReadOnly(GraphData graph)
|
||
|
{
|
||
|
m_Graph = graph;
|
||
|
}
|
||
|
|
||
|
private bool AnyConnectedControl<T>() where T : IControl
|
||
|
{
|
||
|
var matchingNodes = m_Graph.GetNodes<BlockNode>().Where(o => o.descriptor.control is T);
|
||
|
return matchingNodes.SelectMany(o => o.GetInputSlots<MaterialSlot>()).Any(o => o.isConnected);
|
||
|
}
|
||
|
|
||
|
public bool AnyVertexAnimationActive()
|
||
|
{
|
||
|
return AnyConnectedControl<PositionControl>();
|
||
|
}
|
||
|
}
|
||
|
}
|