We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 421f94d commit a0630ffCopy full SHA for a0630ff
Editor.Extras/Drawers/PreviewMeshDrawer.cs
@@ -1,4 +1,5 @@
1
using System;
2
+using System.Linq;
3
using TriInspector;
4
using TriInspector.Drawers;
5
using TriInspector.Elements;
@@ -77,8 +78,19 @@ private Material GetMat
77
78
{
79
if (_mat == null)
80
- _mat = new Material(Shader.Find("Universal Render Pipeline/Lit"));
81
- _mat.color = new Color(0.4f, 0.7f, 0.4f);
+ var shaderNames = new[]
82
+ {
83
+ "Universal Render Pipeline/Lit",
84
+ "Standard",
85
+ "Legacy Shaders/Diffuse",
86
+ };
87
+
88
+ var shader = shaderNames.Select(name => Shader.Find(name)).First(shader => shader != null);
89
90
+ _mat = new Material(shader)
91
92
+ color = new Color(0.4f, 0.7f, 0.4f),
93
94
}
95
return _mat;
96
0 commit comments