Skip to content

Commit 603849d

Browse files
authored
Merge pull request #2 from ertanturan/Bugfix-1
Bugfix 1
2 parents 32fc0be + 745a2df commit 603849d

File tree

5 files changed

+8
-41
lines changed

5 files changed

+8
-41
lines changed

.idea/.idea.Unity-Object-Pooling/.idea/indexLayout.xml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/.idea.Unity-Object-Pooling/.idea/workspace.xml

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/CustomTools/ObjectPooling/Scripts/ObjectPool/ObjectPooler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ public void Despawn(GameObject obj)
9393
{
9494
PooledObjectType pooledObjectType = obj.GetComponent<IPooledObject>().PoolType;
9595

96-
if (pooledObjectType != null && _poolDictionary.ContainsKey(pooledObjectType))
96+
if (_poolDictionary.ContainsKey(pooledObjectType) && // check if there's a queued objects by that tag.
97+
_poolDictionary[pooledObjectType].Contains(gameObject)) // check if `obj` is already despawned
9798
{
9899

99100

@@ -111,7 +112,7 @@ public void Despawn(GameObject obj)
111112
}
112113
else
113114
{
114-
Debug.LogError("Trying to despawn object which is not pooled !");
115+
Debug.LogError("Trying to despawn object which is not pooled or object is already despawned !");
115116
}
116117

117118
}

Packages/manifest.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,11 @@
55
"com.unity.ads": "3.5.2",
66
"com.unity.analytics": "3.3.5",
77
"com.unity.collab-proxy": "1.2.16",
8-
"com.unity.ext.nunit": "1.0.5",
98
"com.unity.ide.rider": "1.1.4",
109
"com.unity.ide.vscode": "1.2.3",
11-
"com.unity.multiplayer-hlapi": "1.0.6",
1210
"com.unity.purchasing": "2.1.1",
13-
"com.unity.test-framework": "1.1.19",
1411
"com.unity.textmeshpro": "2.0.1",
15-
"com.unity.timeline": "1.2.6",
1612
"com.unity.ugui": "1.0.0",
17-
"com.unity.xr.legacyinputhelpers": "2.1.6",
1813
"com.unity.modules.ai": "1.0.0",
1914
"com.unity.modules.androidjni": "1.0.0",
2015
"com.unity.modules.animation": "1.0.0",

Packages/packages-lock.json

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
},
4040
"com.unity.ext.nunit": {
4141
"version": "1.0.5",
42-
"depth": 0,
42+
"depth": 2,
4343
"source": "registry",
4444
"dependencies": {},
4545
"url": "https://packages.unity.com"
@@ -60,15 +60,6 @@
6060
"dependencies": {},
6161
"url": "https://packages.unity.com"
6262
},
63-
"com.unity.multiplayer-hlapi": {
64-
"version": "1.0.6",
65-
"depth": 0,
66-
"source": "registry",
67-
"dependencies": {
68-
"nuget.mono-cecil": "0.1.6-preview"
69-
},
70-
"url": "https://packages.unity.com"
71-
},
7263
"com.unity.purchasing": {
7364
"version": "2.1.1",
7465
"depth": 0,
@@ -80,7 +71,7 @@
8071
},
8172
"com.unity.test-framework": {
8273
"version": "1.1.19",
83-
"depth": 0,
74+
"depth": 1,
8475
"source": "registry",
8576
"dependencies": {
8677
"com.unity.ext.nunit": "1.0.5",
@@ -98,13 +89,6 @@
9889
},
9990
"url": "https://packages.unity.com"
10091
},
101-
"com.unity.timeline": {
102-
"version": "1.2.6",
103-
"depth": 0,
104-
"source": "registry",
105-
"dependencies": {},
106-
"url": "https://packages.unity.com"
107-
},
10892
"com.unity.ugui": {
10993
"version": "1.0.0",
11094
"depth": 0,
@@ -114,20 +98,6 @@
11498
"com.unity.modules.imgui": "1.0.0"
11599
}
116100
},
117-
"com.unity.xr.legacyinputhelpers": {
118-
"version": "2.1.6",
119-
"depth": 0,
120-
"source": "registry",
121-
"dependencies": {},
122-
"url": "https://packages.unity.com"
123-
},
124-
"nuget.mono-cecil": {
125-
"version": "0.1.6-preview",
126-
"depth": 1,
127-
"source": "registry",
128-
"dependencies": {},
129-
"url": "https://packages.unity.com"
130-
},
131101
"com.unity.modules.ai": {
132102
"version": "1.0.0",
133103
"depth": 0,

0 commit comments

Comments
 (0)