Skip to content

Commit

Permalink
Merge pull request #2 from ertanturan/Bugfix-1
Browse files Browse the repository at this point in the history
Bugfix 1
  • Loading branch information
ertanturan committed Feb 3, 2021
2 parents 32fc0be + 745a2df commit 603849d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 41 deletions.
1 change: 1 addition & 0 deletions .idea/.idea.Unity-Object-Pooling/.idea/indexLayout.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/.idea.Unity-Object-Pooling/.idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public void Despawn(GameObject obj)
{
PooledObjectType pooledObjectType = obj.GetComponent<IPooledObject>().PoolType;

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


Expand All @@ -111,7 +112,7 @@ public void Despawn(GameObject obj)
}
else
{
Debug.LogError("Trying to despawn object which is not pooled !");
Debug.LogError("Trying to despawn object which is not pooled or object is already despawned !");
}

}
Expand Down
5 changes: 0 additions & 5 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@
"com.unity.ads": "3.5.2",
"com.unity.analytics": "3.3.5",
"com.unity.collab-proxy": "1.2.16",
"com.unity.ext.nunit": "1.0.5",
"com.unity.ide.rider": "1.1.4",
"com.unity.ide.vscode": "1.2.3",
"com.unity.multiplayer-hlapi": "1.0.6",
"com.unity.purchasing": "2.1.1",
"com.unity.test-framework": "1.1.19",
"com.unity.textmeshpro": "2.0.1",
"com.unity.timeline": "1.2.6",
"com.unity.ugui": "1.0.0",
"com.unity.xr.legacyinputhelpers": "2.1.6",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
"com.unity.modules.animation": "1.0.0",
Expand Down
34 changes: 2 additions & 32 deletions Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"com.unity.ext.nunit": {
"version": "1.0.5",
"depth": 0,
"depth": 2,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
Expand All @@ -60,15 +60,6 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.multiplayer-hlapi": {
"version": "1.0.6",
"depth": 0,
"source": "registry",
"dependencies": {
"nuget.mono-cecil": "0.1.6-preview"
},
"url": "https://packages.unity.com"
},
"com.unity.purchasing": {
"version": "2.1.1",
"depth": 0,
Expand All @@ -80,7 +71,7 @@
},
"com.unity.test-framework": {
"version": "1.1.19",
"depth": 0,
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.5",
Expand All @@ -98,13 +89,6 @@
},
"url": "https://packages.unity.com"
},
"com.unity.timeline": {
"version": "1.2.6",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 0,
Expand All @@ -114,20 +98,6 @@
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.xr.legacyinputhelpers": {
"version": "2.1.6",
"depth": 0,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"nuget.mono-cecil": {
"version": "0.1.6-preview",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.modules.ai": {
"version": "1.0.0",
"depth": 0,
Expand Down

0 comments on commit 603849d

Please sign in to comment.