Working single-purpose object pooling solution

This commit is contained in:
Michal Pikulski
2025-09-16 12:23:25 +02:00
parent 2c56d0e1de
commit bcc6f05058
19 changed files with 990 additions and 115 deletions

View File

@@ -170,7 +170,7 @@ MonoBehaviour:
linePoints: 10
stiffness: 350
damping: 15
ropeLength: 4.19
ropeLength: 2
ropeWidth: 0.1
midPointWeight: 1
midPointPosition: 0.5
@@ -220,17 +220,17 @@ LineRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_Positions:
- {x: 0, y: 2.07, z: 0}
- {x: -0.002, y: 1.5150144, z: 0}
- {x: -0.004, y: 1.0280256, z: 0}
- {x: -0.006, y: 0.6090335, z: 0}
- {x: -0.008, y: 0.25803846, z: 0}
- {x: -0.01, y: -0.024959907, z: 0}
- {x: -0.012, y: -0.23996155, z: 0}
- {x: -0.013999999, y: -0.3869663, z: 0}
- {x: -0.016, y: -0.46597433, z: 0}
- {x: -0.018, y: -0.47698557, z: 0}
- {x: -0.02, y: -0.42000002, z: 0}
- {x: 0, y: 4.1716814, z: 0}
- {x: -0.0011514801, y: 3.9187107, z: 0}
- {x: -0.00230296, y: 3.6922278, z: 0}
- {x: -0.0034544398, y: 3.4922323, z: 0}
- {x: -0.00460592, y: 3.3187256, z: 0}
- {x: -0.0057574, y: 3.1717062, z: 0}
- {x: -0.0069088796, y: 3.0511749, z: 0}
- {x: -0.008060359, y: 2.9571314, z: 0}
- {x: -0.00921184, y: 2.8895762, z: 0}
- {x: -0.010363319, y: 2.8485086, z: 0}
- {x: -0.0115148, y: 2.833929, z: 0}
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
@@ -488,8 +488,8 @@ Transform:
m_GameObject: {fileID: 747976396}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 0, y: 2.9799, z: 0}
m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 730962733}
@@ -573,6 +573,9 @@ MonoBehaviour:
spawnY: -6.78
wobbleMinScale: 0.5
wobbleMaxScale: 1.2
useObjectPooling: 1
initialPoolSize: 10
maxPoolSize: 30
--- !u!4 &1003335105
Transform:
m_ObjectHideFlags: 0
@@ -639,7 +642,7 @@ MonoBehaviour:
linePoints: 10
stiffness: 350
damping: 15
ropeLength: 4.19
ropeLength: 2
ropeWidth: 0.1
midPointWeight: 1
midPointPosition: 0.5
@@ -689,17 +692,17 @@ LineRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_Positions:
- {x: 0, y: 2.07, z: 0}
- {x: 0.06300001, y: 1.5291233, z: 0}
- {x: 0.126, y: 1.053108, z: 0}
- {x: 0.18900001, y: 0.6419541, z: 0}
- {x: 0.25200003, y: 0.29566196, z: 0}
- {x: 0.315, y: 0.01423122, z: 0}
- {x: 0.37800002, y: -0.20233808, z: 0}
- {x: 0.44099998, y: -0.35404575, z: 0}
- {x: 0.504, y: -0.44089204, z: 0}
- {x: 0.567, y: -0.46287674, z: 0}
- {x: 0.63, y: -0.42000002, z: 0}
- {x: 0, y: 4.1716814, z: 0}
- {x: 0.036271624, y: 3.927396, z: 0}
- {x: 0.07254324, y: 3.7076683, z: 0}
- {x: 0.10881486, y: 3.5124984, z: 0}
- {x: 0.14508648, y: 3.3418865, z: 0}
- {x: 0.1813581, y: 3.195832, z: 0}
- {x: 0.21762972, y: 3.0743358, z: 0}
- {x: 0.25390133, y: 2.9773972, z: 0}
- {x: 0.29017296, y: 2.905017, z: 0}
- {x: 0.32644457, y: 2.857194, z: 0}
- {x: 0.3627162, y: 2.833929, z: 0}
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
@@ -976,7 +979,7 @@ MonoBehaviour:
linePoints: 10
stiffness: 350
damping: 15
ropeLength: 4.19
ropeLength: 2
ropeWidth: 0.1
midPointWeight: 1
midPointPosition: 0.5
@@ -1026,17 +1029,17 @@ LineRenderer:
m_SortingLayer: 0
m_SortingOrder: 0
m_Positions:
- {x: 0, y: 2.07, z: 0}
- {x: -0.058000002, y: 1.5269984, z: 0}
- {x: -0.116, y: 1.0493305, z: 0}
- {x: -0.174, y: 0.63699615, z: 0}
- {x: -0.23200001, y: 0.28999573, z: 0}
- {x: -0.29, y: 0.00832893, z: 0}
- {x: -0.348, y: -0.20800425, z: 0}
- {x: -0.406, y: -0.35900372, z: 0}
- {x: -0.46400002, y: -0.44466949, z: 0}
- {x: -0.52199996, y: -0.46500158, z: 0}
- {x: -0.58, y: -0.42000002, z: 0}
- {x: 0, y: 4.1716814, z: 0}
- {x: -0.03339292, y: 3.9260902, z: 0}
- {x: -0.066785835, y: 3.705347, z: 0}
- {x: -0.10017875, y: 3.5094519, z: 0}
- {x: -0.13357168, y: 3.3384047, z: 0}
- {x: -0.16696459, y: 3.1922054, z: 0}
- {x: -0.20035751, y: 3.0708542, z: 0}
- {x: -0.2337504, y: 2.9743507, z: 0}
- {x: -0.26714337, y: 2.9026957, z: 0}
- {x: -0.30053627, y: 2.8558884, z: 0}
- {x: -0.33392918, y: 2.833929, z: 0}
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
@@ -1204,8 +1207,14 @@ MonoBehaviour:
initialTileCount: 3
tileSpawnBuffer: 1
moveSpeed: 3
speedUpFactor: 0.2
speedUpInterval: 2
speedUpFactor: 0
speedUpInterval: 0
maxMoveSpeed: 12
useObjectPooling: 1
preInstantiateTiles: 0
initialTilesPerPrefab: 1
maxPerPrefabPoolSize: 2
totalMaxPoolSize: 10
onTileSpawned:
m_PersistentCalls:
m_Calls: []
@@ -1388,8 +1397,8 @@ Transform:
m_GameObject: {fileID: 2106431001}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: -1, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_LocalPosition: {x: 0, y: 2.5, z: 0}
m_LocalScale: {x: 0.57574, y: 0.57574, z: 0.57574}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1834056337}
@@ -1417,7 +1426,7 @@ MonoBehaviour:
bottleWobble: {fileID: 747976399}
followStiffness: 4
useWobbleOffset: 1
baseY: -1
baseY: 2.5
--- !u!114 &2106431004
MonoBehaviour:
m_ObjectHideFlags: 0