Skip to content

Conversation

@syllebra
Copy link
Collaborator

This PR concern the new tool component that I ported from UP2: the debugshot component.

It complement the BallMoverComponent to create a shot from a mouse click+drag+release which takes the nearest ball, destroy it, create a new one and send it in the given direction with force proportionnal to the segment length.

Hitting "Space" can reshot the last entered shot without using the mouse, and holding "control" when releasing mouse will create a new ball instead of deleting the closest one...

@freezy
Copy link
Owner

freezy commented Mar 28, 2023

vpe-ballshooter.mp4

Sweet!

@arthurkehrwald
Copy link
Collaborator

This is great! Why was it not merged?

@freezy
Copy link
Owner

freezy commented Sep 7, 2024

I'm not sure, I think I wanted to update something before merging.

I'll try to free some time this week-end for this and all your other PR. Again, apologies!

@syllebra
Copy link
Collaborator Author

I'm not sure, I think I wanted to update something before merging.

Good luck! I am glad to see this is not dead. If you need help, I may rtemember a thing or two :D. See you!

@freezy freezy force-pushed the DebugShotComponent branch from 164b22c to 8cecb0b Compare April 20, 2025 10:44
@freezy freezy requested a review from Copilot April 20, 2025 10:44
@freezy freezy self-assigned this Apr 20, 2025
@freezy
Copy link
Owner

freezy commented Apr 20, 2025

Slipped in the new switch animation component as well.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements the new Debug Shot component ported from UP2, adding functionality for creating ball shots via mouse interactions and keyboard shortcuts. Key changes include initializing default drag points in TriggerComponent, adding a SwitchAnimationComponent for switch animations, and introducing new ball shot management and debug components to support shot creation and reshooting functionality.

Reviewed Changes

Copilot reviewed 9 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
VisualPinball.Unity/VPT/Trigger/TriggerComponent.cs Initializes default drag points for improved trigger behavior.
VisualPinball.Unity/VPT/Trigger/SwitchAnimationComponent.cs Introduces switch animation logic based on trigger events and animated transitions.
VisualPinball.Unity/VPT/Ball/BallManager.cs Adds a method to find the nearest ball from a given position for shot determination.
VisualPinball.Unity/Physics/Physics.cs Provides an overload for retrieving local-to-playfield matrix using a Transform.
VisualPinball.Unity/Game/BallShotComponent.cs Implements the debug shot creation and launching mechanics.
VisualPinball.Unity/Game/BallRollerComponent.cs Refactors ball control to inherit from the new BallDebugComponent and adjusts cursor logic.
VisualPinball.Unity/Game/BallDebugComponent.cs Adds common debug functionality and unified cursor position lookup.
VisualPinball.Unity/Common/Handles2.cs Introduces helper methods for drawing gizmo arrows in the editor.
VisualPinball.Unity/VisualPinball.Unity.Editor/Utils/Icons.cs Updates icon lookups to support the new ball shot component.
Files not reviewed (4)
  • VisualPinball.Unity/VisualPinball.Unity/Common/Handles2.cs.meta: Language not supported
  • VisualPinball.Unity/VisualPinball.Unity/Game/BallDebugComponent.cs.meta: Language not supported
  • VisualPinball.Unity/VisualPinball.Unity/Game/BallShotComponent.cs.meta: Language not supported
  • VisualPinball.Unity/VisualPinball.Unity/VPT/Trigger/SwitchAnimationComponent.cs.meta: Language not supported

@freezy freezy merged commit 17f4382 into master Apr 20, 2025
15 checks passed
@freezy freezy deleted the DebugShotComponent branch April 20, 2025 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants