Skip to content

Commit f1d3ea8

Browse files
committed
prefabs: Setup gate provider.
1 parent a696150 commit f1d3ea8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Runtime/PrefabProvider.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1616

17+
using System;
1718
using UnityEngine;
19+
using VisualPinball.Engine.VPT;
1820
using VisualPinball.Unity;
1921

2022
namespace VisualPinball.Engine.Unity.Hdrp
@@ -25,5 +27,20 @@ public GameObject CreateBumper()
2527
{
2628
return UnityEngine.Resources.Load<GameObject>("Prefabs/Bumper");
2729
}
30+
public GameObject CreateGate(int type)
31+
{
32+
switch (type) {
33+
case GateType.GateLongPlate:
34+
return UnityEngine.Resources.Load<GameObject>("Prefabs/Gate - Long Plate");
35+
case GateType.GatePlate:
36+
return UnityEngine.Resources.Load<GameObject>("Prefabs/Gate - Plate");
37+
case GateType.GateWireRectangle:
38+
return UnityEngine.Resources.Load<GameObject>("Prefabs/Gate - Wire Rectangle");
39+
case GateType.GateWireW:
40+
return UnityEngine.Resources.Load<GameObject>("Prefabs/Gate - Wire W");
41+
default:
42+
throw new ArgumentException(nameof(type), $"Unknown gate type {type}.");
43+
}
44+
}
2845
}
2946
}

0 commit comments

Comments
 (0)