Firstborn/Library/PackageCache/com.unity.shadergraph@12.1.8/Editor/Data/Graphs/GraphConcretization.cs
Schaken-Mods b486678290 Library -Artifacts
Library -Artifacts
2023-03-28 12:24:16 -05:00

30 lines
942 B
C#

using System.Linq;
using UnityEngine;
namespace UnityEditor.ShaderGraph
{
sealed partial class GraphData : ISerializationCallbackReceiver
{
public static class GraphConcretization
{
public static void ConcretizeNode(AbstractMaterialNode node)
{
node.Concretize();
}
public static void ConcretizeProperties(GraphData graph)
{
var propertyNodes = graph.GetNodes<PropertyNode>().Where(n => !graph.m_Properties.Any(p => p == n.property)).ToArray();
foreach (var pNode in propertyNodes)
graph.ReplacePropertyNodeWithConcreteNodeNoValidate(pNode);
}
public static void ConcretizeGraph(GraphData graph)
{
ConcretizeProperties(graph);
GraphDataUtils.ApplyActionLeafFirst(graph, ConcretizeNode);
}
}
}
}