Support prefab-aware trough queues for balls. - #578
Merged
Merged
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Troughs can now hold a distinct ball prefab per queue slot, and a drained ball goes back into the queue as the prefab it was created from, so a table with visually different balls keeps them in rotation instead of re-creating every ball from one prefab.
Changes
TroughComponentgainsBallPrefabs, the prefabs in ejection order; an empty slot uses the current render pipeline's default ball. The old singleBallprefab field is kept hidden for migration.TroughApikeeps aBallPrefabQueuesized to the ball count. Ejecting a ball dequeues the front prefab and creates the ball from it; draining a ball destroys it and enqueues its source prefab at the back. A drain for a ball that no longer exists is logged and ignored, and an empty queue while the trough still counts a ball is reported instead of throwing.BallComponentrecords the prefab a runtime ball was instantiated from.BallManagervalidates that a ball prefab carries aBallComponentwith a positive radius on its root and scales the instance relative to the prefab's authored radius instead of overriding its scale.Tests
TroughTests.ShouldPutDrainedBallPrefabsAtBackOfQueuecovers the queue order when balls drain out of order.BallManagerPlayModeTestschecks the default ball's mesh and scale, and that a runtime ball is scaled relative to its authored prefab and tracks its source prefab.Known limitation
Ball prefabs are not carried through a VPE package. The package format stores scriptable-object assets, audio clips and collider meshes, not prefab assets, and the previous single ball prefab was not packaged either. A packaged table ejects the render pipeline's default ball, as before. Packaging authored ball prefabs needs prefab-asset support in the packaging layer and is a separate change.