File tree Expand file tree Collapse file tree 5 files changed +8
-41
lines changed
.idea/.idea.Unity-Object-Pooling/.idea
Assets/CustomTools/ObjectPooling/Scripts/ObjectPool Expand file tree Collapse file tree 5 files changed +8
-41
lines changed Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 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"
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 ,
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" ,
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 ,
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 ,
You can’t perform that action at this time.
0 commit comments