static IConstantNodeModel CreateConstantNodeModel(GraphModel graphModel, string constantName, Type nodeType, TypeHandle constantTypeHandle, Vector2 position, SpawnFlags spawnFlags = SpawnFlags.Default) { void PreDefineSetup(NodeModel model) { if (model is ConstantNodeModel constantModel) { constantModel.PredefineSetup(constantTypeHandle); } } return(graphModel.CreateModel <ConstantNodeModel>(nodeType, constantName, position, spawnFlags, PreDefineSetup)); }