Skip to content

Commit 5909efe

Browse files
committed
api: Add display materials to material converter.
1 parent 322c9a9 commit 5909efe

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Runtime/MaterialConverter.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ namespace VisualPinball.Unity.Urp
2828
{
2929
public class MaterialConverter : IMaterialConverter
3030
{
31+
public UnityEngine.Material DotMatrixDisplay => UnityEngine.Resources.Load<UnityEngine.Material>("Materials/DotMatrixDisplay");
32+
public UnityEngine.Material SegmentDisplay => UnityEngine.Resources.Load<UnityEngine.Material>("Materials/SegmentDisplay");
33+
3134
#region Shader Properties
3235

3336
private static readonly int BaseColor = Shader.PropertyToID("_BaseColor");
@@ -56,11 +59,11 @@ public static UnityEngine.Material GetDefaultMaterial(BlendMode blendMode)
5659
{
5760
switch (blendMode)
5861
{
59-
case Engine.VPT.BlendMode.Opaque:
62+
case BlendMode.Opaque:
6063
return UnityEngine.Resources.Load<UnityEngine.Material>("Materials/TableOpaque");
61-
case Engine.VPT.BlendMode.Cutout:
64+
case BlendMode.Cutout:
6265
return UnityEngine.Resources.Load<UnityEngine.Material>("Materials/TableCutout");
63-
case Engine.VPT.BlendMode.Translucent:
66+
case BlendMode.Translucent:
6467
return UnityEngine.Resources.Load<UnityEngine.Material>("Materials/TableTranslucent");
6568
default:
6669
throw new ArgumentOutOfRangeException("Undefined blend mode " + blendMode);
@@ -93,7 +96,7 @@ public UnityEngine.Material CreateMaterial(PbrMaterial vpxMaterial, TableAuthori
9396
}
9497

9598

96-
if (vpxMaterial.MapBlendMode == Engine.VPT.BlendMode.Translucent)
99+
if (vpxMaterial.MapBlendMode == BlendMode.Translucent)
97100
{
98101
col.a = Mathf.Min(1, Mathf.Max(0, vpxMaterial.Opacity));
99102
}

0 commit comments

Comments
 (0)