|
|
|
|
|
|
// Unity specifics
|
|
|
|
public static Material CreateEngineMaterial(string shaderPath) |
|
|
|
{ |
|
|
|
var mat = new Material(Shader.Find(shaderPath)) |
|
|
|
Shader shader = Shader.Find(shaderPath); |
|
|
|
if (shader == null) |
|
|
|
{ |
|
|
|
Debug.LogError("Cannot create required material because shader " + shaderPath + " could not be found"); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
var mat = new Material(shader) |
|
|
|
{ |
|
|
|
hideFlags = HideFlags.HideAndDontSave |
|
|
|
}; |
|
|
|
|
|
|
public static Material CreateEngineMaterial(Shader shader) |
|
|
|
{ |
|
|
|
if (shader == null) |
|
|
|
{ |
|
|
|
Debug.LogError("Cannot create required material because shader is null"); |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
var mat = new Material(shader) |
|
|
|
{ |
|
|
|
hideFlags = HideFlags.HideAndDontSave |
|
|
|