Skip to content

Object Pooling Bullets#15

Merged
Sturlock merged 1 commit intodevelopfrom
feature/ObjectPoolingBullets
Apr 27, 2025
Merged

Object Pooling Bullets#15
Sturlock merged 1 commit intodevelopfrom
feature/ObjectPoolingBullets

Conversation

@Sturlock
Copy link
Copy Markdown
Owner

No description provided.

@Sturlock Sturlock added the enhancement New feature or request label Apr 22, 2025
@Sturlock Sturlock self-assigned this Apr 22, 2025
@what-the-diff
Copy link
Copy Markdown

what-the-diff bot commented Apr 22, 2025

PR Summary

  • Enhancement to Gun component:
    The Gun.prefab now has a new component (BulletPool) added to it, which helps in improving its functionality.

  • Bullet behavior improvements:
    The file Bullet.cs was tweaked with new private variables for better bullet handling and control. Moreover, the Start method now sets up the _TrailRenderer and a new ResetBullet method has been created for efficient bullet recycling. Bullets are no longer destroyed when they hit a target, they are now reset, considering optimal resource use.

  • BulletPool.cs addition:
    A brand-new class called BulletPool.cs has been introduced to manage a pool of bullets. This results in a performance boost as the bullets are reused instead of being created and destroyed repeatedly.

  • Efficient bullet management in WeaponFireControl:
    WeaponFireControl.cs has adapted to use the new BulletPool for handling bullets. This implies a shift to a more efficient method of handling bullets by retrieving them from the BulletPool.

  • Better clarity in Magazine.cs:
    The property name _MaxAmmunition has been encapsulated to MaxAmmunition so it can be accessed publicly. A comment has also been added to deliver a fuller understanding of the properties' purposes.

Copy link
Copy Markdown
Collaborator

@EduardHClevett EduardHClevett left a comment

Choose a reason for hiding this comment

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

LGTM!

@Sturlock Sturlock merged commit 9e1475a into develop Apr 27, 2025
8 checks passed
@Sturlock Sturlock deleted the feature/ObjectPoolingBullets branch April 27, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants