diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f16fd730..981974371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ Built with Unity 2021.2. - Native trough component ([#229](https://github.com/freezy/VisualPinball.Engine/pull/229), [#248](https://github.com/freezy/VisualPinball.Engine/pull/248), [#256](https://github.com/freezy/VisualPinball.Engine/pull/256), [Documentation](https://docs.visualpinball.org/creators-guide/manual/mechanisms/troughs.html)). ### Changed +- Playfield is now rotated to the correct angle during gameplay ([#370](https://github.com/freezy/VisualPinball.Engine/pull/370)) - Decouple light components from transformation override ([#350](https://github.com/freezy/VisualPinball.Engine/pull/350)). - Refactored drag points. They are nicely separated and typed now. - Collider debug view is now much faster and intuitive. It's also activated per default when there is no visible mesh. diff --git a/VisualPinball.Unity/VisualPinball.Unity.Editor/VPT/Playfield/PlayfieldInspector.cs b/VisualPinball.Unity/VisualPinball.Unity.Editor/VPT/Playfield/PlayfieldInspector.cs index c6a8cb454..20e231017 100644 --- a/VisualPinball.Unity/VisualPinball.Unity.Editor/VPT/Playfield/PlayfieldInspector.cs +++ b/VisualPinball.Unity/VisualPinball.Unity.Editor/VPT/Playfield/PlayfieldInspector.cs @@ -28,6 +28,7 @@ public class PlayfieldInspector : MainInspector private SerializedProperty _tableHeightProperty; private SerializedProperty _angleTiltMinProperty; private SerializedProperty _angleTiltMaxProperty; + private SerializedProperty _renderSlopeProperty; protected override void OnEnable() { @@ -39,6 +40,7 @@ protected override void OnEnable() _tableHeightProperty = serializedObject.FindProperty(nameof(PlayfieldComponent.TableHeight)); _angleTiltMinProperty = serializedObject.FindProperty(nameof(PlayfieldComponent.AngleTiltMin)); _angleTiltMaxProperty = serializedObject.FindProperty(nameof(PlayfieldComponent.AngleTiltMax)); + _renderSlopeProperty = serializedObject.FindProperty(nameof(PlayfieldComponent.RenderSlope)); } public override void OnInspectorGUI() @@ -59,6 +61,7 @@ public override void OnInspectorGUI() }); PropertyField(_angleTiltMinProperty, "Slope for Min. Difficulty"); PropertyField(_angleTiltMaxProperty, "Slope for Max. Difficulty"); + PropertyField(_renderSlopeProperty, "Rendered Playfield Angle"); base.OnInspectorGUI(); diff --git a/VisualPinball.Unity/VisualPinball.Unity/VPT/Playfield/PlayfieldComponent.cs b/VisualPinball.Unity/VisualPinball.Unity/VPT/Playfield/PlayfieldComponent.cs index 4c783cab1..ef0aea232 100644 --- a/VisualPinball.Unity/VisualPinball.Unity/VPT/Playfield/PlayfieldComponent.cs +++ b/VisualPinball.Unity/VisualPinball.Unity/VPT/Playfield/PlayfieldComponent.cs @@ -61,6 +61,9 @@ public class PlayfieldComponent : MainRenderableComponent public float AngleTiltMin = 6f; + [Tooltip("How much the playfield should be rotated during runtime (in edit time, we keep it horizontal)")] + public float RenderSlope = 3.6f; + public int PlayfieldDetailLevel = 10; public float GravityStrength = 1.762985f; @@ -102,6 +105,8 @@ private void Awake() if (meshComp) { World.DefaultGameObjectInjectionWorld.GetOrCreateSystem().CollideAgainstPlayfieldPlane = meshComp.AutoGenerate; } + + transform.RotateAround(Vector3.zero, Vector3.right, -RenderSlope); } public override IEnumerable SetData(TableData data) diff --git a/VisualPinball.Unity/VisualPinball.Unity/VPT/Trigger/TriggerMeshComponent.cs b/VisualPinball.Unity/VisualPinball.Unity/VPT/Trigger/TriggerMeshComponent.cs index 7ca3a396e..33b935277 100644 --- a/VisualPinball.Unity/VisualPinball.Unity/VPT/Trigger/TriggerMeshComponent.cs +++ b/VisualPinball.Unity/VisualPinball.Unity/VPT/Trigger/TriggerMeshComponent.cs @@ -33,8 +33,9 @@ public class TriggerMeshComponent : MeshComponent public int Shape; - [Min(0)] + [Range(0, 6)] [Tooltip("Thickness of the trigger wire. Doesn't have any impact on the ball.")] + public float WireThickness; #endregion