Skip to content

Commit 776cc8a

Browse files
committed
despawn on the update disabled.
1 parent d7872df commit 776cc8a

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

Assets/Scripts/ObjectPool/PooledObject.cs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ public virtual void AddRandomForce()
4242
_rb.AddForce(random);
4343
}
4444

45-
private void Update()
46-
{
47-
//The timer stands for only demostration reasons .
48-
//Remove it or comment it than you can despawn your objects whenever you want !.
49-
50-
if (_timer > 0)
51-
{
52-
_timer -= Time.deltaTime;
53-
}
54-
else
55-
{
56-
ObjectPooler.Instance.Despawn(Type,gameObject);
57-
}
58-
}
45+
//private void Update()
46+
//{
47+
// //The timer stands for only demostration reasons .
48+
// //Remove it or comment it than you can despawn your objects whenever you want !.
49+
50+
// if (_timer > 0)
51+
// {
52+
// _timer -= Time.deltaTime;
53+
// }
54+
// else
55+
// {
56+
// ObjectPooler.Instance.Despawn(Type,gameObject);
57+
// }
58+
//}
5959

6060
}

0 commit comments

Comments
 (0)