-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CollisionSwitchComponent #344
Conversation
Codecov Report
@@ Coverage Diff @@
## master #344 +/- ##
=======================================
Coverage 83.91% 83.91%
=======================================
Files 125 125
Lines 6741 6741
=======================================
Hits 5657 5657
Misses 1084 1084 Continue to review full report at Codecov.
|
VisualPinball.Unity/VisualPinball.Unity/VPT/CollisionSwitch/CollisionSwitchApi.cs
Outdated
Show resolved
Hide resolved
VisualPinball.Unity/VisualPinball.Unity.Editor/Inspectors/CollisionSwitchInspector.cs
Outdated
Show resolved
Hide resolved
So I had a chance to look at the switch manager status. Since this same switch ID is currently hooked to 6 collision switches, the status is only updated when one of the collision switches is enabled. It looks like the switch statuses are stored in a dictionary by ID. Additional switches with the same ID, just override the dictionary value. So the last component is the one that is used for the status: VisualPinball.Engine/VisualPinball.Unity/VisualPinball.Unity/Game/SwitchPlayer.cs Lines 87 to 90 in 67aca1d
Thoughts on this? |
That's okay, no? I agree it's a bit weird in the editor, but any of those elements triggers the same switch, so it's kinda logical that they all change status synchronously. The other way of handling this would be to additionally store switch statuses in a switch mapping -> status dictionary, just for the editor. I'd create a GitHub issue about this and move along. :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it's good to merge!
Sorry, I guess I didn't explain it properly. I'll create another issue. Switch
If the user hits However, if the user hits The Game Logic Engine will work fine and PinMame registers the switch for The SwitchPlayer statuses are a dictionary by ID VisualPinball.Engine/VisualPinball.Unity/VisualPinball.Unity/Game/SwitchPlayer.cs Lines 87 to 90 in 67aca1d
So when the player is populating the dictionary, each ID So that's why the manager looks like its only monitoring one device. |
This component will expose switches for the following components that inherit
IApiHittable
This was needed as there are switches behind the drop target banks and non-slingshots in Rock.
This PR also does the following:
netstandard2.1
and C# 9.0VisualPinball.Engine.Unity.sln
compilation errors using Visual Studio.FluentAssertions to 6.2.0
.unity
folder with latest managed dlls for compiling in Visual Studio without Unity(Copied from
/Applications/Unity/Hub/Editor/2021.2.3f1/Unity.app/Contents/Managed/UnityEngine
andScriptAssemblies
)Remaining:
CollisionSwitch
(@freezy)IApiHittable
)