File tree Expand file tree Collapse file tree 4 files changed +8
-12
lines changed
VisualPinball.Unity/VisualPinball.Unity.Editor
AssetBrowser/AssetStructure Expand file tree Collapse file tree 4 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -64,17 +64,14 @@ public class Asset : ScriptableObject
64
64
public List < AssetMaterialVariation > MaterialVariations ;
65
65
66
66
[ SerializeField ]
67
- public string ThumbBackgroundObjectName ;
67
+ public string EnvironmentGameObjectName ;
68
68
69
69
[ SerializeReference ]
70
70
public Preset ThumbCameraPreset ;
71
71
72
72
[ SerializeField ]
73
73
public float ThumbCameraHeight ;
74
74
75
- [ SerializeField ]
76
- public bool ThumbTopLight ;
77
-
78
75
[ SerializeField ]
79
76
public bool UnpackPrefab ;
80
77
Original file line number Diff line number Diff line change @@ -171,7 +171,7 @@ public void Bind(Asset asset)
171
171
172
172
private void BindBackgroundObjects ( )
173
173
{
174
- var bgo = _body . Q < ObjectDropdownElement > ( "background-object -field" ) ;
174
+ var bgo = _body . Q < ObjectDropdownElement > ( "environment -field" ) ;
175
175
var bgParent = SceneManager . GetActiveScene ( ) . GetRootGameObjects ( )
176
176
. FirstOrDefault ( go => go . name == "_BackgroundObjects" ) ;
177
177
@@ -180,14 +180,14 @@ private void BindBackgroundObjects()
180
180
return ;
181
181
}
182
182
bgo . visible = true ;
183
- bgo . Value = _asset . ThumbBackgroundObjectName != null ? bgParent . transform . Find ( _asset . ThumbBackgroundObjectName ) ? . gameObject : null ;
183
+ bgo . Value = _asset . EnvironmentGameObjectName != null ? bgParent . transform . Find ( _asset . EnvironmentGameObjectName ) ? . gameObject : null ;
184
184
bgo . AddObjectsToDropdown < MeshRenderer > ( bgParent , true ) ;
185
- bgo . RegisterValueChangedCallback ( OnThumbBackgroundObjectChanged ) ;
185
+ bgo . RegisterValueChangedCallback ( OnThumbEnvironmentChanged ) ;
186
186
}
187
187
188
- private void OnThumbBackgroundObjectChanged ( Object obj )
188
+ private void OnThumbEnvironmentChanged ( Object obj )
189
189
{
190
- _asset . ThumbBackgroundObjectName = obj . name ;
190
+ _asset . EnvironmentGameObjectName = obj . name ;
191
191
}
192
192
193
193
private void BindInfo ( Asset asset )
Original file line number Diff line number Diff line change 33
33
<!-- Geometry -->
34
34
<ui:Foldout text="Thumbnail Settings">
35
35
<ui:VisualElement class="left-indent">
36
- <uivpe:ObjectDropdownElement name="background-object- field" label="On Object " />
36
+ <uivpe:ObjectDropdownElement name="environment- field" label="Environment " />
37
37
<uivpe:PresetDropdownElement name="thumb-camera-preset" binding-path="ThumbCameraPreset" label="Camera" preset-path="Packages/org.visualpinball.engine.unity/VisualPinball.Unity/Assets/Presets/Asset Thumbcam" />
38
38
<uie:PropertyField binding-path="ThumbCameraHeight" label="Z-Position" />
39
- <uie:PropertyField binding-path="ThumbTopLight" label="Enable Top Light" />
40
39
</ui:VisualElement>
41
40
</ui:Foldout>
42
41
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ private void OnSceneGUI()
101
101
var localPos = MainComponent . GetEditorPosition ( ) ;
102
102
localPos . z = MainComponent . PositionZ ;
103
103
104
- var worldPos = transform . parent . TransformPoint ( localPos ) ;
104
+ var worldPos = transform . parent == null ? localPos : transform . parent . TransformPoint ( localPos ) ;
105
105
106
106
foreach ( var coil in MainComponent . Coils ) {
107
107
var from = MainComponent . GetBallCreationPosition ( ) . ToUnityVector3 ( ) ;
You can’t perform that action at this time.
0 commit comments