How can I create a material in an editor script in much the same way as I would from a shader asset?
Shader myShader = (Shader)AssetDatabase.LoadAssetAtPath(shaderPath, typeof(Shader));
Material mat = new Material(myshader);
Material mat2 = new Material( ?? myshader.shadergraph)
// Create a new material with the same properties as the imported material
Material newMaterial = null;
defaultShader = Shader.Find("Shader Graphs/SphereMask");
if (defaultShader != null)
{
newMaterial = new Material(defaultShader);
}
else
{
Debug.LogError("Couldn't load shader");
}