Open
Conversation
I really love the direction this project is heading and wanted to contribute! Main changes in this PR: - **Separated UI logic** Extracted all UI-related responsibilities (coin counter updates, level complete panel display, etc.) from `GameManager` into a dedicated `GameUI` (or `LevelUI`) component. → This follows the **Single Responsibility Principle** more closely, simplifies `GameManager`, and makes UI changes much easier and safer. - **Introduced object pooling for pickups** Added a simple `Destructible` component that pickups now use. Instead of calling `Destroy(gameObject)`, we return objects to an object pool for reuse. → Reduces garbage collection pressure, improves performance (especially with many coins/gems), and sets up a foundation for better object management later. - **Other small clean-ups & improvements** - Better naming & null checks in several places - Minor refactoring for readability and consistency - Adjusted pickup destruction logic to work with the pool These changes should make the codebase cleaner, more performant, and easier to extend in the future. Happy to discuss / adjust anything — looking forward to feedback!
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.
I really love the direction this project is heading and wanted to contribute!
Main changes in this PR:
Separated UI logic Extracted all UI-related responsibilities (coin counter updates, level complete panel display, etc.) from
GameManagerinto a dedicatedGameUI(orLevelUI) component. → This follows the Single Responsibility Principle more closely, simplifiesGameManager, and makes UI changes much easier and safer.Introduced object pooling for pickups Added a simple
Destructiblecomponent that pickups now use. Instead of callingDestroy(gameObject), we return objects to an object pool for reuse. → Reduces garbage collection pressure, improves performance (especially with many coins/gems), and sets up a foundation for better object management later.Other small clean-ups & improvements
These changes should make the codebase cleaner, more performant, and easier to extend in the future.
Happy to discuss / adjust anything — looking forward to feedback!