A project-conversion class used in the editor to convert old ShaderGraph MissingNode instances into the newer ShaderGraphPlus MissingNode nodes. It maps identifier, position and content from the old node and returns the new node in a list.
using VanillaGraph = Editor.ShaderGraph;
using ShaderGraphBaseNode = Editor.ShaderGraph.BaseNode;
namespace ShaderGraphPlus.Internal;
internal class MissingNodeConvert : BaseNodeConvert
{
public override Type NodeTypeToConvert => typeof( VanillaGraph.MissingNode );
public override IEnumerable<BaseNodePlus> Convert( ProjectConverter converter, ShaderGraphBaseNode oldNode )
{
var newNodes = new List<BaseNodePlus>();
var oldMissingNodeNode = oldNode as VanillaGraph.MissingNode;
var newNode = new Nodes.MissingNode();
newNode.Identifier = oldNode.Identifier;
newNode.Position = oldNode.Position;
newNode.Content = oldMissingNodeNode.Content;
newNodes.Add( newNode );
return newNodes;
}
}