-
Notifications
You must be signed in to change notification settings - Fork 1
Release 0.12.1 #19
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
Release 0.12.1 #19
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,12 @@ All notable changes to this package will be documented in this file. | |
| The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
| and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [0.12.1] - 2024-10-25 | ||
|
|
||
| **Fixed**: | ||
| - The endless loop when calling *RngService.Range()* | ||
| - The endless loop *GameObjectPool* when spawning new entities | ||
|
|
||
| ## [0.12.0] - 2024-10-22 | ||
|
|
||
| - Added IRngData to PoolService to suppprt read only data structure and allow abtract injection of data into other objects | ||
|
|
@@ -51,13 +57,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. | |
|
|
||
| ## [0.7.1] - 2023-07-28 | ||
|
|
||
| **Fixed**: | ||
| - Compilation errors in various test files and the PoolService class have been fixed. | ||
|
|
||
| **Changed**: | ||
| - Tests have been moved to proper folders, and the package number has been updated. | ||
| - An unused namespace import has been removed from the InstallerTest class. | ||
|
Comment on lines
61
to
62
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| **Fixed**: | ||
| - Compilation errors in various test files and the PoolService class have been fixed. | ||
|
|
||
|
Comment on lines
+65
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| ## [0.7.0] - 2023-07-28 | ||
|
|
||
| - Introduced a code review process using GitHub Actions workflow. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -344,7 +344,7 @@ public class GameObjectPool : ObjectPoolBase<GameObject> | |
| /// If true then when the object is despawned back to the pool will be parented to the same as the sample entity | ||
| /// parent transform | ||
| /// </summary> | ||
| public bool DespawnToSampleParent { get; set; } | ||
| public bool DespawnToSampleParent { get; set; } = true; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| public GameObjectPool(uint initSize, GameObject sampleEntity) : base(initSize, sampleEntity, Instantiator) | ||
| { | ||
|
|
@@ -375,7 +375,7 @@ public static GameObject Instantiator(GameObject entityRef) | |
|
|
||
| protected override GameObject SpawnEntity() | ||
| { | ||
| var entity = SpawnEntity(); | ||
| var entity = base.SpawnEntity(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| entity.SetActive(true); | ||
|
|
||
|
|
@@ -403,7 +403,7 @@ public class GameObjectPool<T> : ObjectPoolBase<T> where T : Behaviour | |
| /// If true then when the object is despawned back to the pool will be parented to the same as the sample entity | ||
| /// parent transform | ||
| /// </summary> | ||
| public bool DespawnToSampleParent { get; set; } | ||
| public bool DespawnToSampleParent { get; set; } = true; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| public GameObjectPool(uint initSize, T sampleEntity) : base(initSize, sampleEntity, Instantiator) | ||
| { | ||
|
|
@@ -442,14 +442,17 @@ protected override T SpawnEntity() | |
| { | ||
| T entity = null; | ||
|
|
||
| do | ||
| while(entity == null) | ||
| { | ||
| entity = SpawnEntity(); | ||
| entity = base.SpawnEntity(); | ||
|
|
||
| if(entity.gameObject == null) | ||
| { | ||
| SpawnedEntities.Remove(entity); | ||
|
|
||
| entity = null; | ||
| } | ||
| } | ||
|
Comment on lines
+445
to
455
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The changes made in this section address a potential issue with spawning entities. The new implementation uses a Overall, the changes in Suggestions
TestingHere are some potential test cases to consider for testing the
These tests can be automated using Unity's testing framework and executed in both EditMode and RuntimeMode to ensure the correctness and reliability of the |
||
| // ReSharper disable once ConditionIsAlwaysTrueOrFalse | ||
| // Need to do while loop and check as parent objects could have destroyed the entity/gameobject before it could | ||
| // be properly disposed by pool service | ||
| while (entity == null || entity.gameObject == null); | ||
|
|
||
| entity.gameObject.SetActive(true); | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -205,8 +205,8 @@ public static int[] Restore(int count, int seed) | |
| /// </summary> | ||
| public static int Range(int min, int max, int[] rndState, bool maxInclusive) | ||
| { | ||
| var floatMin = min; | ||
| var floatMax = max; | ||
| floatP floatMin = min; | ||
| floatP floatMax = max; | ||
|
Comment on lines
+208
to
+209
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The variable declarations in the To fix this issue, you can replace - floatP floatMin = min;
- floatP floatMax = max;
+ float floatMin = min;
+ float floatMax = max;This will ensure that the variables are correctly declared as Please note that if |
||
|
|
||
| return Range(floatMin, floatMax, rndState, maxInclusive); | ||
| } | ||
|
|
||
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.
The description of the fixed issues is not clear. Please provide more specific details about the endless loop problems in
RngService.Range()andGameObjectPoolwhen spawning new entities.0.7.1 - 2023-07-28