22
22
using PinMame ;
23
23
using UnityEditor ;
24
24
using UnityEngine ;
25
- using VisualPinball . Engine . Common ;
26
- using VisualPinball . Engine . Game . Engines ;
27
25
using VisualPinball . Engine . PinMAME . Games ;
28
26
using VisualPinball . Unity ;
29
27
using VisualPinball . Unity . Editor ;
@@ -43,7 +41,7 @@ public class PinMameGamelogicEngineInspector : UnityEditor.Editor
43
41
private int _selectedGameIndex ;
44
42
private int _selectedRomIndex ;
45
43
46
- private TableAuthoring _tableAuthoring ;
44
+ private TableComponent _tableComponent ;
47
45
48
46
private PinMameRom Rom => _gle . Game . Roms [ _selectedRomIndex ] ;
49
47
@@ -62,7 +60,7 @@ private void OnEnable()
62
60
. ToArray ( ) ;
63
61
64
62
if ( _gle != null ) {
65
- _tableAuthoring = _gle . gameObject . GetComponentInParent < TableAuthoring > ( ) ;
63
+ _tableComponent = _gle . gameObject . GetComponentInParent < TableComponent > ( ) ;
66
64
}
67
65
68
66
if ( IsGameSet ) {
@@ -124,13 +122,13 @@ public override void OnInspectorGUI()
124
122
//EditorGUI.BeginDisabledGroup(!IsGameSet || Application.isPlaying);
125
123
if ( GUILayout . Button ( "Populate Hardware" ) ) {
126
124
if ( EditorUtility . DisplayDialog ( "PinMAME" , "This will clear all linked switches, coils and lamps and re-populate them. You sure you want to do that?" , "Yes" , "No" ) ) {
127
- _tableAuthoring . RepopulateHardware ( _gle ) ;
125
+ _tableComponent . RepopulateHardware ( _gle ) ;
128
126
TableSelector . Instance . TableUpdated ( ) ;
129
127
SceneView . RepaintAll ( ) ;
130
128
}
131
129
}
132
130
if ( GUILayout . Button ( "Create Displays" ) ) {
133
- var sceneDisplays = FindObjectsOfType < DisplayAuthoring > ( ) ;
131
+ var sceneDisplays = FindObjectsOfType < DisplayComponent > ( ) ;
134
132
if ( sceneDisplays . Length > 0 ) {
135
133
if ( EditorUtility . DisplayDialog ( "PinMAME" , "This will re-position all your displays, if you have any. You sure you want to do that?" , "Yes" , "No" ) ) {
136
134
CreateDisplays ( sceneDisplays ) ;
@@ -144,24 +142,24 @@ public override void OnInspectorGUI()
144
142
//EditorGUI.EndDisabledGroup();
145
143
}
146
144
147
- private void CreateDisplays ( IEnumerable < DisplayAuthoring > sceneDisplays )
145
+ private void CreateDisplays ( IEnumerable < DisplayComponent > sceneDisplays )
148
146
{
149
147
// retrieve layouts from pinmame
150
148
var pinMame = PinMame . PinMame . Instance ( AudioSettings . outputSampleRate ) ;
151
149
var displayLayouts = pinMame . GetAvailableDisplays ( _gle . romId ) ;
152
150
153
151
// retrieve already existing displays from scene
154
- var displayGameObjects = new Dictionary < string , DisplayAuthoring > ( ) ;
152
+ var displayGameObjects = new Dictionary < string , DisplayComponent > ( ) ;
155
153
foreach ( var displays in sceneDisplays ) {
156
154
displayGameObjects [ displays . Id ] = displays ;
157
155
}
158
- var ta = _gle . GetComponentInParent < TableAuthoring > ( ) ;
159
- var pa = _gle . GetComponentInChildren < PlayfieldAuthoring > ( ) ;
156
+ var ta = _gle . GetComponentInParent < TableComponent > ( ) ;
157
+ var pa = _gle . GetComponentInChildren < PlayfieldComponent > ( ) ;
160
158
var tableHeight = 0f ;
161
159
var tableWidth = 1f ;
162
160
if ( ta ) {
163
- tableHeight = pa . GlassHeight * PlayfieldAuthoring . GlobalScale ;
164
- tableWidth = pa . Width * PlayfieldAuthoring . GlobalScale ;
161
+ tableHeight = pa . GlassHeight * PlayfieldComponent . GlobalScale ;
162
+ tableWidth = pa . Width * PlayfieldComponent . GlobalScale ;
165
163
}
166
164
167
165
// get total height
@@ -195,8 +193,8 @@ private void CreateDisplays(IEnumerable<DisplayAuthoring> sceneDisplays)
195
193
196
194
if ( layout . IsDmd ) {
197
195
var auth = ! displayGameObjects . ContainsKey ( id )
198
- ? go . AddComponent < DotMatrixDisplayAuthoring > ( )
199
- : go . GetComponent < DotMatrixDisplayAuthoring > ( ) ;
196
+ ? go . AddComponent < DotMatrixDisplayComponent > ( )
197
+ : go . GetComponent < DotMatrixDisplayComponent > ( ) ;
200
198
201
199
auth . Id = id ;
202
200
auth . Width = layout . Width ;
@@ -208,8 +206,8 @@ private void CreateDisplays(IEnumerable<DisplayAuthoring> sceneDisplays)
208
206
209
207
} else {
210
208
var auth = ! displayGameObjects . ContainsKey ( id )
211
- ? go . AddComponent < SegmentDisplayAuthoring > ( )
212
- : go . GetComponent < SegmentDisplayAuthoring > ( ) ;
209
+ ? go . AddComponent < SegmentDisplayComponent > ( )
210
+ : go . GetComponent < SegmentDisplayComponent > ( ) ;
213
211
214
212
auth . Id = id ;
215
213
auth . NumChars = layout . Length ;
0 commit comments