com.amanotes.prefabpool 1.0.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -8
- package/Runtime/PrefabPool.cs +8 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.1.0] - 2026-04-21
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `IPrefabPool.MarkShutdown()` — marks pool as shut down so Get/Return calls no-op safely
|
|
7
|
+
- `PrefabPool.MarkShutdown()` implementation — sets `_isDestroyed = true`
|
|
8
|
+
|
|
3
9
|
## [1.0.3] - 2026-04-07
|
|
4
10
|
|
|
5
11
|
### Fixed
|
|
6
|
-
- `PoolEntry.Return
|
|
12
|
+
- `PoolEntry.Return` renames pooled GameObjects back to entry `id` in Editor
|
|
7
13
|
|
|
8
14
|
## [1.0.2] - 2026-04-06
|
|
9
15
|
|
|
10
16
|
### Fixed
|
|
11
|
-
- `PoolEntry.Return
|
|
12
|
-
- `PoolEntry.Get
|
|
13
|
-
- `PoolEntry.PreAllocate
|
|
14
|
-
- `PrefabPool.DestroyPool
|
|
15
|
-
- `PrefabPool.Initialize
|
|
16
|
-
- `PoolEntry.PurgeDestroyed
|
|
17
|
-
- `PrefabPool.PurgeStaleInstanceMap
|
|
17
|
+
- `PoolEntry.Return` deactivates before `SetParent` to prevent parent activation error
|
|
18
|
+
- `PoolEntry.Get` explicit `SetActive(true)` for consistent pool state
|
|
19
|
+
- `PoolEntry.PreAllocate` prewarm objects spawned inactive
|
|
20
|
+
- `PrefabPool.DestroyPool` properly destroys `_customPool` entries
|
|
21
|
+
- `PrefabPool.Initialize` added `_isInitializing` guard against double-prewarm
|
|
22
|
+
- `PoolEntry.PurgeDestroyed` removes stale refs on `Register`
|
|
23
|
+
- `PrefabPool.PurgeStaleInstanceMap` cleans up externally-destroyed objects (Editor only)
|
|
18
24
|
|
|
19
25
|
## [1.0.1]
|
|
20
26
|
|
|
27
|
+
### Added
|
|
21
28
|
- Initial release
|
package/Runtime/PrefabPool.cs
CHANGED
|
@@ -168,6 +168,12 @@ namespace Amanotes.Core
|
|
|
168
168
|
GameObject Get(PoolGroup group, string prefabId, Vector3 localPosition = default, Transform customParent = null);
|
|
169
169
|
void Return(PoolGroup group, GameObject gameObject);
|
|
170
170
|
IEnumerator Initialize();
|
|
171
|
+
/// <summary>
|
|
172
|
+
/// Marks the pool as shut down so all subsequent Get/Return calls no-op safely.
|
|
173
|
+
/// Call this before detaching tiles during game shutdown to prevent SetParent errors
|
|
174
|
+
/// when the pool's hierarchy is being deactivated.
|
|
175
|
+
/// </summary>
|
|
176
|
+
void MarkShutdown();
|
|
171
177
|
}
|
|
172
178
|
|
|
173
179
|
public static class PrefabPoolExtensions
|
|
@@ -308,6 +314,8 @@ namespace Amanotes.Core
|
|
|
308
314
|
|
|
309
315
|
public bool IsReady => _isReady;
|
|
310
316
|
|
|
317
|
+
public void MarkShutdown() => _isDestroyed = true;
|
|
318
|
+
|
|
311
319
|
public void RegisterGroup(PoolGroup group, Transform spawnParent)
|
|
312
320
|
{
|
|
313
321
|
if (group == null) return;
|
package/package.json
CHANGED