Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class PlayfieldInspector : MainInspector<TableData, PlayfieldComponent>
private SerializedProperty _tableHeightProperty;
private SerializedProperty _angleTiltMinProperty;
private SerializedProperty _angleTiltMaxProperty;
private SerializedProperty _renderSlopeProperty;

protected override void OnEnable()
{
Expand All @@ -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()
Expand All @@ -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();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public class PlayfieldComponent : MainRenderableComponent<TableData>

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;
Expand Down Expand Up @@ -102,6 +105,8 @@ private void Awake()
if (meshComp) {
World.DefaultGameObjectInjectionWorld.GetOrCreateSystem<StaticNarrowPhaseSystem>().CollideAgainstPlayfieldPlane = meshComp.AutoGenerate;
}

transform.RotateAround(Vector3.zero, Vector3.right, -RenderSlope);
}

public override IEnumerable<MonoBehaviour> SetData(TableData data)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ public class TriggerMeshComponent : MeshComponent<TriggerData, TriggerComponent>

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
Expand Down